4 ms·
This is the code running this endpoint: export function onRequest(context) { return new Response(JSON.stringify([parseFloat(context.request.cf.longitude)
by louison11 3y ago
This is the code running this endpoint:
export function onRequest(context) {
return new Response(JSON.stringify([parseFloat(context.request.cf.longitude), parseFloat(context.request.cf.latitude)]), {headers: {"Content-Type": "application/json;charset=UTF-8"}})
}
This is a function on Cloudflare Pages (which is just a different name for Cloudflare Workers). Minor adjustment needed for Workers (get rid of "context", I believe)