Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-static-assets-routing-single-page-application-spa-workflow-guide.mdDocumentation 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.textA 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.textA 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.textAn 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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

  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/routing/single-page-application