Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Return small HTML page

Demonstrates how to return a basic HTML response by embedding an HTML string directly within a Cloudflare Worker script.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Return small HTML page

Demonstrates how to return a basic HTML response by embedding an HTML string directly within a Cloudflare Worker script.

When To Use

Use when you need to serve a simple HTML response directly from a Cloudflare Worker without using external storage or complex templating engines.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-examples-return-html-small-page-workflow-guide.mdA markdown document demonstrating how to return a small HTML page from an HTML string within a Cloudflare Worker script.Questions about a markdown document demonstrating how to return a small HTML page from an HTML string within a Cloudflare Worker script.
examples/workers-examples-return-html-small-page-cloudflare-workers-return-html.textA JavaScript code example demonstrating how to return a basic HTML response from a Cloudflare Worker using the fetch handler.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to return a basic HTML response from a Cloudflare Worker using the fetch...
examples/workers-examples-return-html-small-page-cloudflare-workers-return-html-2.textA Cloudflare Worker script that returns a basic HTML response with the correct content-type header.Exact payloads, commands, or snippets shown in A Cloudflare Worker script that returns a basic HTML response with the correct content-type header.
examples/workers-examples-return-html-small-page-cloudflare-workers-python-return.textA Python implementation of a Cloudflare Worker that returns a basic HTML response using the WorkerEntrypoint class.Exact payloads, commands, or snippets shown in A Python implementation of a Cloudflare Worker that returns a basic HTML response using the WorkerEntrypoint class.
examples/workers-examples-return-html-small-page-cloudflare-workers-return-html-r.textA Rust code example demonstrating how to use a Cloudflare Worker to return a small HTML response using the Response::from_html method.Exact payloads, commands, or snippets shown in A Rust code example demonstrating how to use a Cloudflare Worker to return a small HTML response using the Response::...
examples/workers-examples-return-html-small-page-cloudflare-workers-hono-return-h.textA Cloudflare Worker using the Hono framework to serve a basic HTML response.Exact payloads, commands, or snippets shown in A Cloudflare Worker using the Hono framework to serve a basic HTML response.

What This Skill Covers

  • Deliver an HTML page from an HTML string directly inside the Worker script.
  • Main sections: Tags.

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/examples/return-html