/custom-headers-example

Example Workers template showing how to add, remove, or update HTTP headers using Cloudflare Workers

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Custom Headers Example

A template for customizing HTTP response headers using Cloudflare Workers.

index.js is the content of the Workers script.

Getting Started

To generate using wrangler

wrangler generate projectname https://github.com/cloudflare/custom-headers-example

Further documentation for Wrangler can be found here.

Configuration

Fill in your account_id, zone_id, and route in wrangler.toml.

When your wrangler.toml is configured, you can publish your Workers function using wrangler publish:

$ wrangler publish