Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers http

Instructions for enabling and using the Node.js http module in Cloudflare Workers, including specific compatibility flags required for client-side and server-side HTTP functionality.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers http

Instructions for enabling and using the Node.js http module in Cloudflare Workers, including specific compatibility flags required for client-side and server-side HTTP functionality.

When To Use

Use when you need to enable Node.js http module support in a Cloudflare Worker to perform client-side GET requests or set up server-side HTTP servers using Node.js syntax.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-runtime-apis-nodejs-http-workflow-guide.mdDocumentation detailing the Node.js http module compatibility, including client-side and server-side methods and required compatibility flags for Cloudflare Workers.Questions about documentation detailing the Node.js http module compatibility, including client-side and server-side methods and requ...
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-compatib.textA configuration snippet showing the compatibility flags required to enable Node.js HTTP module support in Cloudflare Workers.Exact payloads, commands, or snippets shown in A configuration snippet showing the compatibility flags required to enable Node.js HTTP module support in Cloudflare...
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-compatib-2.textA text snippet showing the required compatibility flags to enable Node.js HTTP module support in Cloudflare Workers.Exact payloads, commands, or snippets shown in A text snippet showing the required compatibility flags to enable Node.js HTTP module support in Cloudflare Workers.
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http.textA text example demonstrating the implementation of the Node.js HTTP module within a Cloudflare Workers environment.Exact payloads, commands, or snippets shown in A text example demonstrating the implementation of the Node.js HTTP module within a Cloudflare Workers environment.
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-server-c.textA text snippet showing the required compatibility flags to enable Node.js HTTP server modules in Cloudflare Workers.Exact payloads, commands, or snippets shown in A text snippet showing the required compatibility flags to enable Node.js HTTP server modules in Cloudflare Workers.
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-compatib-3.textA text configuration showing the compatibility flags required to enable Node.js HTTP and HTTPS server modules in Cloudflare Workers.Exact payloads, commands, or snippets shown in A text configuration showing the compatibility flags required to enable Node.js HTTP and HTTPS server modules in Clou...
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-compatib-4.textA configuration snippet showing the required compatibility flags to enable Node.js HTTP and HTTPS server modules in Cloudflare Workers.Exact payloads, commands, or snippets shown in A configuration snippet showing the required compatibility flags to enable Node.js HTTP and HTTPS server modules in C...
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-get-requ.textA JavaScript example demonstrating how to use the node:http module within a Cloudflare Worker to perform a GET request.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to use the node:http module within a Cloudflare Worker to perform a GET request.
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-get-requ-2.textA JavaScript example demonstrating how to use the node:http module to perform a GET request within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to use the node:http module to perform a GET request within a Cloudflare Worker.
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-get-inco.textA JavaScript example demonstrating how to use the node:http module to perform a GET request and validate an IncomingMessage instance within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to use the node:http module to perform a GET request and validate an IncomingM...
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-server.textA Node.js http module implementation using createServer to handle requests within a Cloudflare Worker environment.Exact payloads, commands, or snippets shown in A Node.js http module implementation using createServer to handle requests within a Cloudflare Worker environment.
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-agent.textA text example demonstrating the usage of the node:http Agent within a Cloudflare Workers environment.Exact payloads, commands, or snippets shown in A text example demonstrating the usage of the node:http Agent within a Cloudflare Workers environment.
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-server-2.textA Node.js HTTP server implementation using createServer and httpServerHandler for Cloudflare Workers.Exact payloads, commands, or snippets shown in A Node.js HTTP server implementation using createServer and httpServerHandler for Cloudflare Workers.
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-server-h.textA text example demonstrating how to use the httpServerHandler to wrap a Node.js http server for use within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A text example demonstrating how to use the httpServerHandler to wrap a Node.js http server for use within a Cloudfla...
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-server-3.textA Node.js HTTP server implementation using createServer that is handled as a Node request within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A Node.js HTTP server implementation using createServer that is handled as a Node request within a Cloudflare Worker.
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-server-4.textA Node.js http module implementation using the Server class to handle requests within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A Node.js http module implementation using the Server class to handle requests within a Cloudflare Worker.
examples/workers-runtime-apis-nodejs-http-cloudflare-workers-nodejs-http-server-5.textA Node.js http module example demonstrating how to create a server and stream JSON responses within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A Node.js http module example demonstrating how to create a server and stream JSON responses within a Cloudflare Worker.

What This Skill Covers

  • To enable built-in Node.js APIs and polyfills, add the nodejs\compat compatibility flag to your Wrangler configuration file. This also enables nodejs\compat...
  • Main sections: Compatibility flags, Client-side methods, Server-side methods, get, request.

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/nodejs/http