you know what let's just change frontend framework again
This commit is contained in:
parent
c8cd483d20
commit
0d47f1fb01
115 changed files with 4407 additions and 10824 deletions
13
Foxnouns.Frontend/src/hooks.server.ts
Normal file
13
Foxnouns.Frontend/src/hooks.server.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { PRIVATE_API_HOST, PRIVATE_INTERNAL_API_HOST } from "$env/static/private";
|
||||
import { PUBLIC_API_BASE } from "$env/static/public";
|
||||
import type { HandleFetch } from "@sveltejs/kit";
|
||||
|
||||
export const handleFetch: HandleFetch = async ({ request, fetch }) => {
|
||||
if (request.url.startsWith(`${PUBLIC_API_BASE}/internal`)) {
|
||||
request = new Request(request.url.replace(PUBLIC_API_BASE, PRIVATE_INTERNAL_API_HOST), request);
|
||||
} else if (request.url.startsWith(PUBLIC_API_BASE)) {
|
||||
request = new Request(request.url.replace(PUBLIC_API_BASE, PRIVATE_API_HOST), request);
|
||||
}
|
||||
|
||||
return await fetch(request);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue