- Remove the old Hono/Bun proxy server - Add the new `apps/frontend` SvelteKit scaffold and telemetry hook
16 lines
572 B
TypeScript
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;
|