fix env vars

This commit is contained in:
2022-12-06 17:00:23 +02:00
parent 17b3c9c666
commit 6c46524ab3
5 changed files with 13 additions and 9 deletions

View File

@ -1,11 +1,12 @@
import type { PageServerLoad } from "./$types";
import { compile } from "mdsvex";
import { env } from "$env/dynamic/private";
export const load: PageServerLoad = async () => {
return {
state: await fetch(import.meta.env.VITE_API_URL + "/api/v1/state/announcements").then((res) => res.json()),
announcements: await fetch(import.meta.env.VITE_API_URL + "/api/v1/announcements").then((res) => res.json()),
content: await fetch(import.meta.env.VITE_API_URL + "/api/v1/announcements").then((res) => res.json()).then((res) => compile(res.title)).then((res) => res.code)
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)
}
}