From f606f5572883e84ffceaf2b67c763946cab868db Mon Sep 17 00:00:00 2001 From: "netop://ウィビ" Date: Sat, 30 May 2026 12:36:33 -0700 Subject: updates blog panel and modularizes about panel --- src/routes/api/about.json/+server.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/routes/api/about.json/+server.ts (limited to 'src/routes/api/about.json') 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); + } +}; -- cgit v1.2.3