Skip to content

Instantly share code, notes, and snippets.

@bitbonsai
Created December 1, 2023 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitbonsai/03f4f578b2521f7c51b1c3c05e6cb70c to your computer and use it in GitHub Desktop.
Save bitbonsai/03f4f578b2521f7c51b1c3c05e6cb70c to your computer and use it in GitHub Desktop.
Serverless function that returns continent from Cloudfare Pages
export function onRequest(context) {
return new Response(JSON.stringify({
continent: context.request.cf.continent
}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment