Files
illusory-iotam/apps/frontend/src/hooks.server.ts
user eee31e5b99 Replace front proxy with new SvelteKit frontend app
- Remove the old Hono/Bun proxy server
- Add the new `apps/frontend` SvelteKit scaffold and telemetry hook
2026-03-28 18:12:43 +02:00

16 lines
572 B
TypeScript

import type { Handle, HandleServerError } from "@sveltejs/kit";
export const handleError: HandleServerError = async ({ error, event }) => {
console.log("[-] Running error middleware for : ", event.url.pathname);
console.log(error);
return { message: (error as Error).message ?? "Internal Server Error" };
};
export const middleware: Handle = async ({ event, resolve }) => {
event.locals.flowId ||= crypto.randomUUID();
console.log("[+] Running middleware for : ", event.url.pathname);
return resolve(event);
};
export const handle = middleware;