In this case, an Edge Function is used to implement the redirection of the request, returning a 302 response to the client.
const REDIRECT_URL = 'https://edgeone.ai';
async function handelRequest() {
return Response.redirect(REDIRECT_URL)
}
addEventListener('fetch', (event) => {
event.respondWith(handelRequest(event.request))
});