mirror of
https://github.com/Cian-H/am-d-model.eu.git
synced 2025-12-22 13:41:56 +00:00
Test of hook approach to solve sveltekit routing issues with reverse proxy
This commit is contained in:
12
src/hooks.server.js
Normal file
12
src/hooks.server.js
Normal 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);
|
||||
};
|
||||
Reference in New Issue
Block a user