diff options
| author | netop://ウィビ <paul@webb.page> | 2026-05-30 12:36:33 -0700 |
|---|---|---|
| committer | netop://ウィビ <paul@webb.page> | 2026-05-30 12:36:33 -0700 |
| commit | f606f5572883e84ffceaf2b67c763946cab868db (patch) | |
| tree | 4a4abb29da88cbb677bf24e0f1c532488ea38c53 /src/routes/api/about.json | |
| parent | ecafa83e14045ebda8a00b251ab62cfc2d7f3012 (diff) | |
| download | homepage-f606f5572883e84ffceaf2b67c763946cab868db.tar.gz homepage-f606f5572883e84ffceaf2b67c763946cab868db.zip | |
updates blog panel and modularizes about panel
Diffstat (limited to 'src/routes/api/about.json')
| -rw-r--r-- | src/routes/api/about.json/+server.ts | 27 |
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); + } +}; |