cloudflare · Cloudflare Workers Docs
Workers Serving a subdirectory
Configures a Cloudflare Worker with static assets to serve content from a specific subpath by mirroring the directory structure within the asset directory and using Wrangler configuration.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers Serving a subdirectory
Configures a Cloudflare Worker with static assets to serve content from a specific subpath by mirroring the directory structure within the asset directory and using Wrangler configuration.
When To Use
Use when you need to host static files under a specific subdirectory of your domain rather than at the root level using Cloudflare Workers assets.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-static-assets-routing-serving-a-subdirectory-workflow-guide.md | A guide explaining how to configure Cloudflare Workers to serve static assets from a specific subdirectory using Wrangler. | Questions about a guide explaining how to configure Cloudflare Workers to serve static assets from a specific subdirectory using Wran... |
examples/workers-static-assets-routing-serving-a-subdirectory-cloudflare-workers-.text | A wrangler.toml configuration file demonstrating how to route static assets to a specific subdirectory using the assets field. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating how to route static assets to a specific subdirectory using the asse... |
examples/workers-static-assets-routing-serving-a-subdirectory-cloudflare-workers--2.text | A wrangler configuration file demonstrating how to route static assets to a specific subdirectory path. | Exact payloads, commands, or snippets shown in A wrangler configuration file demonstrating how to route static assets to a specific subdirectory path. |
What This Skill Covers
- This feature requires Wrangler v3.98.0 or later.
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/static-assets/routing/advanced/serving-a-subdirectory
