Cloudflare

Delivering a Serverless API in 10 minutes using Workers

Jun 28, 2018Rita Kozlov
Delivering a Serverless API in 10 minutes using Workers
SummaryAI, from the source post

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.

More from the Edge Computing with Cloudflare Workers trail