Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-runtime-apis-handlers-fetch-handler-workflow-guide.mdDocumentation 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.textA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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