Please do not ping anyone for help, this is a volunteer community and people will help as and when t
Please do not ping anyone for help, this is a volunteer community and people will help as and when they are available to

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. 



pages dev functions and restarting on code changes.onRequest from a different folder, and I use the wrangler dev bundling. The details are here: wrangler pages dev when functions are not in root?export async function onRequestPost(context) { I am trying to POST some JSON to it. While logging context or context.request, or context.request.body I don't see the data I am passing in from a POST via curl or Postman. Request like text() & json(). So, if your request body is JSON, then you'd do...const redirectURL = new URL('/login/', 'https://example.com');
return Response.redirect(redirectURL.toString());return new Response(null, {
status: 302,
headers: {
location: '/login/',
}
});function 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;
} 'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': '*',
'Access-Control-Allow-Methods': 'GET,HEAD,POST,OPTIONS',pages devexport async function onRequestPost(context) {context.requestcontext.requestcontext.request.bodyRequesttext()json()export async function onRequest(ctx) {
const response = Response.json({ response: { session: generateUUID() } });
response.headers.set("Access-Control-Allow-Origin", "*")
response.headers.set("Access-Control-Allow-Headers", "*")
response.headers.set("Access-Control-Allow-Methods", "GET,HEAD,POST,OPTIONS")
return response;
}const json = await context.request.json()
console.log(json.property);