Add frontend
This commit is contained in:
12
frontend/src/routes/scripts/+page.server.js
Normal file
12
frontend/src/routes/scripts/+page.server.js
Normal file
@@ -0,0 +1,12 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user