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
This commit is contained in:
15
apps/frontend/src/hooks.server.ts
Normal file
15
apps/frontend/src/hooks.server.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user