Files
Sharpbin/SharpbinV3.Client/src/routes/+layout.server.ts
T
2026-06-17 22:18:55 -04:00

16 lines
499 B
TypeScript

import type { LayoutServerLoad } from './$types';
import { error } from '@sveltejs/kit';
export const load: LayoutServerLoad = async ({ fetch, url }) => {
const res = await fetch('/api/auth/info');
const pasteOptionsRes = await fetch('/api/paste/info');
if (!res.ok || !pasteOptionsRes.ok) {
throw error(503, 'Failed to load site configuration.');
}
const options = await res.json();
const pasteOptions = await pasteOptionsRes.json();
return { options, pasteOptions, url: url.href };
};