cloudflare · Cloudflare Workers Docs
Workers Single Page Application (SPA)
Configures Cloudflare Workers to support Single Page Applications by setting up assets.notfoundhandling to serve index.html for unmatched navigation requests and managing routing behavior to reduce Worker invocations.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers Single Page Application (SPA)
Configures Cloudflare Workers to support Single Page Applications by setting up assets.notfoundhandling to serve index.html for unmatched navigation requests and managing routing behavior to reduce Worker invocations.
When To Use
Use when you need to configure Cloudflare Workers to serve a single index.html file for all unmatched navigation requests to support client-side routing in frameworks like React or Vue.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-static-assets-routing-single-page-application-spa-workflow-guide.md | Documentation explaining how to configure Cloudflare Workers static assets to support client-side routing for Single Page Applications. | Questions about documentation explaining how to configure Cloudflare Workers static assets to support client-side routing for Single... |
examples/workers-static-assets-routing-single-page-application-spa-cloudflare-wor.text | A wrangler.toml configuration file demonstrating the notfoundhandling setting for single-page application routing in Cloudflare Workers. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating the notfoundhandling setting for single-page application routing in... |
examples/workers-static-assets-routing-single-page-application-spa-cloudflare-wor-2.text | A wrangler.toml configuration file setting the notfoundhandling option to single-page-application for Cloudflare Workers static assets. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration file setting the notfoundhandling option to single-page-application for Cloudflare Work... |
examples/workers-static-assets-routing-single-page-application-spa-cloudflare-wor-3.text | An HTML template demonstrating a single page application structure with an OAuth callback mechanism for Cloudflare Workers static assets. | Exact payloads, commands, or snippets shown in An HTML template demonstrating a single page application structure with an OAuth callback mechanism for Cloudflare Wo... |
examples/workers-static-assets-routing-single-page-application-spa-cloudflare-wor-4.text | A JavaScript implementation of a WorkerEntrypoint that handles SPA routing and API callback logic for Cloudflare Workers static assets. | Exact payloads, commands, or snippets shown in A JavaScript implementation of a WorkerEntrypoint that handles SPA routing and API callback logic for Cloudflare Work... |
examples/workers-static-assets-routing-single-page-application-spa-cloudflare-wor-5.text | A TypeScript implementation of a WorkerEntrypoint that handles SPA routing by intercepting requests and managing specific API paths. | Exact payloads, commands, or snippets shown in A TypeScript implementation of a WorkerEntrypoint that handles SPA routing by intercepting requests and managing spec... |
examples/workers-static-assets-routing-single-page-application-spa-cloudflare-wor-6.text | A wrangler.toml configuration file demonstrating the notfoundhandling setting for single-page application routing using Cloudflare Workers static assets. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating the notfoundhandling setting for single-page application routing usi... |
examples/workers-static-assets-routing-single-page-application-spa-cloudflare-wor-7.text | A wrangler.toml configuration file demonstrating the notfoundhandling setting for single-page application routing in Cloudflare Workers. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating the notfoundhandling setting for single-page application routing in... |
examples/workers-static-assets-routing-single-page-application-spa-cloudflare-wor-8.text | A JavaScript fetch handler implementation that routes requests to either an API endpoint or a 404 response to support single-page application routing. | Exact payloads, commands, or snippets shown in A JavaScript fetch handler implementation that routes requests to either an API endpoint or a 404 response to support... |
examples/workers-static-assets-routing-single-page-application-spa-cloudflare-wor-9.text | A JavaScript worker script demonstrating how to route requests to a single page application by handling API paths and returning a 404 for other routes. | Exact payloads, commands, or snippets shown in A JavaScript worker script demonstrating how to route requests to a single page application by handling API paths and... |
What This Skill Covers
- Single Page Applications (SPAs) are web applications which are client-side rendered (CSR). They are often built with a framework such as React, Vue or Svelte...
- Main sections:
Configuration,Navigation requests,Client-side callbacks,Advanced routing control,Local Development.
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/single-page-application
