aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/about.json
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/routes/api/about.json/+server.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/routes/api/about.json/+server.ts b/src/routes/api/about.json/+server.ts
new file mode 100644
index 0000000..cdfd7b7
--- /dev/null
+++ b/src/routes/api/about.json/+server.ts
@@ -0,0 +1,27 @@
+
+
+
+/*** IMPORT ------------------------------------------- ***/
+
+import { error, json } from "@sveltejs/kit";
+
+/*** UTILITY ------------------------------------------ ***/
+
+import { default as markdown } from "$lib/utility/markdown.ts";
+
+/*** EXPORT ------------------------------------------- ***/
+
+export const POST = async({ fetch, request }) => {
+ try {
+ const response = await fetch("https://about.webb.page", {
+ headers: { "Content-Type": "text/plain" },
+ method: "GET"
+ });
+
+ const content = await response.text();
+ return json({ content: markdown(content) });
+ } catch(welp) {
+ console.error(`Error fetching About: ${String(welp)}`);
+ return error(500);
+ }
+};