mirror of
https://github.com/ProjectSegfault/website.git
synced 2024-11-18 14:13:00 +05:30
13 lines
566 B
TypeScript
13 lines
566 B
TypeScript
import type { PageServerLoad } from "./$types";
|
|
import { compile } from "mdsvex";
|
|
import { env } from "$env/dynamic/private";
|
|
|
|
export const load: PageServerLoad = async () => {
|
|
return {
|
|
state: await fetch(env.VITE_API_URL + "/api/v1/state/announcements").then((res) => res.json()),
|
|
announcements: await fetch(env.VITE_API_URL + "/api/v1/announcements").then((res) => res.json()),
|
|
content: await fetch(env.VITE_API_URL + "/api/v1/announcements").then((res) => res.json()).then((res) => compile(res.title)).then((res) => res.code)
|
|
}
|
|
}
|
|
|