Delivering a Serverless API in 10 minutes using Workers
Jun 28, 2018Rita Kozlov

Summary
This post introduces a Cloudflare Worker that acts as a serverless API endpoint. It takes a domain as input via a query string and checks if accessing it via HTTP results in a redirect to HTTPS. The Worker uses the `fetch` API to follow redirects and inspects the final URL. It also includes CORS headers to allow cross-origin requests and demonstrates basic error handling and response formatting. The post highlights the speed and simplicity of deploying such an endpoint using Workers.