Is there any way to debug the page function? I can not find a solution
Is there any way to debug the page function? I can not find a solution
npx wrangler pages dev -- SERVER COMMAND . You are also able to get the logs of your functions by pressing "d"._worker file to configured with wrangler v3.22.1. Tested with a fresh npm create cloudflare@latest install with svelte . Picked both the TypeScript and JavaScript versions but neither are working

new URL as the second parameter, so you could do something like:new URL(context.request.url), and then pass the .hostname of that into that new constructor, or just override its .pathname etc. to construct your redirect URLlocation header, so perhaps even this could work (untested):12, which will likely break depending on your domaincanceled, make sure you read the response body (even if you don't need it).
undocumented implementation detail. Like providing dummy properly formatted URI in fetch request to desired Service Binding. Nevertheless, @kian suggestion worked. 

npx wrangler pages dev -- SERVER COMMAND_workerv3.22.1npm create cloudflare@latestsveltenew URLnew URL(context.request.url).hostname.pathnamelocation12canceledfunction generateUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (Math.random() * 16) | 0,
v = c == 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
export async function onRequest(ctx) {
const response = Response.json({ response: { session: generateUUID() } });
response.headers.set('Access-Control-Allow-Origin', '*');
return response;
}export default {
async fetch(request, env) {
const url = new URL(request.url);
if (url.pathname.startsWith('/api/')) {
return new Response('Ok');
}
return env.ASSETS.fetch(request);
}
};const redirectURL = new URL('/login/', 'https://example.com');
return Response.redirect(redirectURL.toString());return new Response(null, {
status: 302,
headers: {
location: '/login/',
}
});