Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Static Assets

Explains how to deploy and serve static assets alongside Cloudflare Workers, including configuration via Wrangler, routing logic between assets and Worker code, and handling single-page application routing.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Static Assets

Explains how to deploy and serve static assets alongside Cloudflare Workers, including configuration via Wrangler, routing logic between assets and Worker code, and handling single-page application routing.

When To Use

Use when you need to deploy a full-stack application that serves HTML, CSS, and images alongside custom Worker logic or configure SPA routing behavior on Cloudflare Workers.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-static-assets-index-workflow-guide.mdAn overview of Cloudflare Workers static assets covering routing, caching behavior, and deployment methods.Questions about an overview of Cloudflare Workers static assets covering routing, caching behavior, and deployment methods.
examples/workers-static-assets-index-cloudflare-workers-static-assets-react-npm-c.textA command line instruction for initializing a React application using the Cloudflare create command to utilize Workers Static Assets.Exact payloads, commands, or snippets shown in A command line instruction for initializing a React application using the Cloudflare create command to utilize Worker...
examples/workers-static-assets-index-cloudflare-workers-static-assets-react-app-c.textThe shell command used to initialize a new React application using the Cloudflare create command for Workers Static Assets.Exact payloads, commands, or snippets shown in The shell command used to initialize a new React application using the Cloudflare create command for Workers Static A...
examples/workers-static-assets-index-cloudflare-workers-static-assets-react-scaff.textThe shell command used to scaffold a new React application optimized for Cloudflare Workers Static Assets using pnpm.Exact payloads, commands, or snippets shown in The shell command used to scaffold a new React application optimized for Cloudflare Workers Static Assets using pnpm.
examples/workers-static-assets-index-cloudflare-workers-static-assets-wrangler-co.textA wrangler.toml configuration example defining the assets directory and binding for a Cloudflare Workers project.Exact payloads, commands, or snippets shown in A wrangler.toml configuration example defining the assets directory and binding for a Cloudflare Workers project.
examples/workers-static-assets-index-cloudflare-workers-static-assets-wrangler-co-2.textA wrangler configuration file example defining the assets directory, binding, and compatibility date for a Cloudflare Workers project.Exact payloads, commands, or snippets shown in A wrangler configuration file example defining the assets directory, binding, and compatibility date for a Cloudflare...
examples/workers-static-assets-index-cloudflare-workers-static-assets-index-js.textA JavaScript index.js file demonstrating how to handle API routes and fetch static assets within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript index.js file demonstrating how to handle API routes and fetch static assets within a Cloudflare Worker.
examples/workers-static-assets-index-cloudflare-workers-static-assets-python-entr.textA Python implementation of a WorkerEntrypoint that serves static assets while handling specific API routes.Exact payloads, commands, or snippets shown in A Python implementation of a WorkerEntrypoint that serves static assets while handling specific API routes.
examples/workers-static-assets-index-cloudflare-workers-static-assets-configurati.textA configuration object demonstrating the assets property settings for directory mapping and single-page application error handling in Cloudflare Workers.Exact payloads, commands, or snippets shown in A configuration object demonstrating the assets property settings for directory mapping and single-page application e...
examples/workers-static-assets-index-cloudflare-workers-static-assets-configurati-2.textA configuration snippet demonstrating the assets directory and notfoundhandling settings for Cloudflare Workers Static Assets.Exact payloads, commands, or snippets shown in A configuration snippet demonstrating the assets directory and notfoundhandling settings for Cloudflare Workers Stati...
examples/workers-static-assets-index-cloudflare-workers-static-assets-wrangler-to.textA wrangler.toml configuration file demonstrating the assets property settings for single-page application deployment.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating the assets property settings for single-page application deployment.
examples/workers-static-assets-index-cloudflare-workers-static-assets-wrangler-to-2.textA wrangler.toml configuration file demonstrating the setup for Workers Static Assets with single-page application handling and asset directory binding.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating the setup for Workers Static Assets with single-page application han...

What This Skill Covers

  • You can upload static assets (HTML, CSS, images and other files) as part of your Worker, and Cloudflare will handle caching and serving them to web browsers.
  • Main sections: How it works, Routing behavior, Caching behavior, Try it out, Learn more.

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/static-assets/index.md