Test of hook approach to solve sveltekit routing issues with reverse proxy

This commit is contained in:
2025-01-23 16:21:56 +00:00
parent f7bd3aef6d
commit deb163ff38

12
src/hooks.server.js Normal file
View File

@@ -0,0 +1,12 @@
export const handle = async ({ event, resolve }) => {
// Paths to be handled by proxy
const proxyPaths = ["repo"];
if (proxyPaths.some(path => event.url.pathname.startsWith(path))) {
// Return empty response, letting proxy handle it
return new Response(null, { status: 404 });
}
// Let SvelteKit handle other paths
return resolve(event);
};