// All region URL setsconst urls = {CN: 'https://www.example.com/zh-CN',US: 'https://www.example.com/en-US',};// Default redirect URLconst defaultUrl = 'https://www.example.com/en-US';/*** Redirect to the target URL based on the region of the current request* @param { Request } request*/function handleRequest(request) {// Get the region of the current requestconst alpha2code = request.eo.geo.countryCodeAlpha2;// Redirect target URLconst url = urls[alpha2code] || defaultUrl;return Response.redirect(url, 302);}addEventListener('fetch', event => {event.respondWith(handleRequest(event.request));});

피드백