diff --git a/cloudflare-worker/index.js b/cloudflare-worker/index.js new file mode 100644 index 0000000..a732696 --- /dev/null +++ b/cloudflare-worker/index.js @@ -0,0 +1,19 @@ +/** + * Welcome to Cloudflare Workers! This is your first worker. + * + * - Run "npm run dev" in your terminal to start a development server + * - Open a browser tab at http://localhost:8787/ to see your worker in action + * - Run "npm run deploy" to publish your worker + * + * Learn more at https://developers.cloudflare.com/workers/ + */ + +export default { + fetch(request, env, ctx) { + return new Response(JSON.stringify( + { + ip: request.headers.get('cf-connecting-ip'), + }, + )) + } +}