Make console.log appear on every request that is not authping

This commit is contained in:
qowevisa 2024-11-10 08:20:44 +02:00
parent 9bb01c811b
commit be64733578

View File

@ -6,19 +6,22 @@ import type { HandleFetch } from "@sveltejs/kit";
// return await resolve(event)
// }
console.log("in hooks file: 1")
export const handleFetch: HandleFetch = async ({ request, fetch }) => {
console.log(request)
console.log("handleFetch triggered for URL:", request.url);
console.log("in handleFetch: 2")
if (!request.url.match('authping')) {
console.log(request)
console.log("handleFetch triggered for URL:", request.url);
console.log("in handleFetch: 2")
}
if (request.url.startsWith("https://api.fin.qowevisa.click/api")) {
request = new Request(
request.url.replace("https://api.fin.qowevisa.click/api", "http://localhost:3000/api"),
request
)
};
console.log(request)
console.log("in handleFetch: 3")
if (!request.url.match('authping')) {
console.log(request)
console.log("in handleFetch: 3")
}
return fetch(request);
};