cloudflare · Cloudflare Workers Docs
Workers Fetch Handler
Explains how to implement the fetch event handler to process incoming HTTP requests and return Response objects within a Cloudflare Worker, including the use of request, env, and ctx parameters.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers Fetch Handler
Explains how to implement the fetch event handler to process incoming HTTP requests and return Response objects within a Cloudflare Worker, including the use of request, env, and ctx parameters.
When To Use
Use when you need to implement the primary entry point for a Cloudflare Worker to handle incoming HTTP requests and manage environment bindings or request lifecycle methods.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-runtime-apis-handlers-fetch-handler-workflow-guide.md | Documentation describing the fetch handler interface, including request and response object handling in the Cloudflare Workers runtime. | Questions about documentation describing the fetch handler interface, including request and response object handling in the Cloudflar... |
examples/workers-runtime-apis-handlers-fetch-handler-cloudflare-workers-fetch-han.text | A basic JavaScript implementation of the Workers Fetch Handler using the export default syntax to return a 'Hello World!' response. | Exact payloads, commands, or snippets shown in A basic JavaScript implementation of the Workers Fetch Handler using the export default syntax to return a 'Hello Wor... |
What This Skill Covers
- Incoming HTTP requests to a Worker are passed to the fetch() handler as a Request object. To respond to the request with a response, return a Response object:
- Main sections:
Background,Parameters.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.cloudflare.com/workers/runtime-apis/handlers/fetch
