diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 3b835c8..89f47a2 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -1,5 +1,8 @@ +import { TimelineReader } from '$lib/server/timeline'; import type { HandleServerError } from '@sveltejs/kit'; +TimelineReader.init(); + export const handleError = (({ error }) => { if (error instanceof Error) { console.error('Something went wrong: ', error.name, error.message); diff --git a/src/routes/+server.ts b/src/routes/+server.ts index 6f777fc..3eae499 100644 --- a/src/routes/+server.ts +++ b/src/routes/+server.ts @@ -1,8 +1,5 @@ -import { TimelineReader } from '$lib/server/timeline'; import type { RequestHandler } from './$types'; -TimelineReader.init(); - export const GET = (async ({ fetch }) => { return await fetch('api/posts'); }) satisfies RequestHandler; \ No newline at end of file