export default {
async fetch(request, env, ctx) {
// Get the city and region from the request headers
const city = request.headers.get('CF-IPCity')
const region = request.headers.get('CF-IPRegion')
// Return a response with the city and region
return new Response(`User's city: ${city}, region: ${region}`, {
headers: { 'content-type': 'text/plain' },
})
},
};
export default {
async fetch(request, env, ctx) {
// Get the city and region from the request headers
const city = request.headers.get('CF-IPCity')
const region = request.headers.get('CF-IPRegion')
// Return a response with the city and region
return new Response(`User's city: ${city}, region: ${region}`, {
headers: { 'content-type': 'text/plain' },
})
},
};