import { error } from '@sveltejs/kit'; import { fetchScripts } from '$lib/api'; /** @type {import('./$types').PageServerLoad} */ export async function load() { try { const scripts = await fetchScripts(); return { scripts }; } catch (err) { throw error(500, 'Failed to fetch scripts - ' + err); } }