Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Single Page App (SPA) shell with bootstrap data

Implements a pattern to inject prefetched API data into a Single Page Application shell using HTMLRewriter to eliminate initial client-side data fetching. It covers two deployment scenarios: using Workers Static Asset...

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Single Page App (SPA) shell with bootstrap data

Implements a pattern to inject prefetched API data into a Single Page Application shell using HTMLRewriter to eliminate initial client-side data fetching. It covers two deployment scenarios: using Workers Static Asset...

When To Use

Use when you need to reduce initial load times for a Single Page Application by pre-injecting serialized API data into the HTML shell before the client-side JavaScript executes.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-examples-spa-shell-single-page-app-with-bootstrap-data-workflow-guide.mdA guide demonstrating how to use HTMLRewriter to inject bootstrap data into a Single Page Application shell served via Cloudflare Workers.Questions about a guide demonstrating how to use HTMLRewriter to inject bootstrap data into a Single Page Application shell served vi...
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar.textA wrangler.toml configuration file for a Cloudflare Workers Single Page Application using assets with single-page-application notfoundhandling.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file for a Cloudflare Workers Single Page Application using assets with single-page-app...
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-2.textA wrangler.toml configuration file setting up a single-page application shell with asset bindings and SPA not-found handling.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file setting up a single-page application shell with asset bindings and SPA not-found h...
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-3.textA Cloudflare Workers script that serves a Single Page Application shell and injects bootstrap data into the response.Exact payloads, commands, or snippets shown in A Cloudflare Workers script that serves a Single Page Application shell and injects bootstrap data into the response.
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-4.textA Cloudflare Workers script implementation of a Single Page Application shell that serves static assets and injects bootstrap data into the response.Exact payloads, commands, or snippets shown in A Cloudflare Workers script implementation of a Single Page Application shell that serves static assets and injects b...
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-5.textA wrangler.toml configuration file for a Cloudflare Workers Single Page App shell including SPA origin and API base URL environment variables.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file for a Cloudflare Workers Single Page App shell including SPA origin and API base U...
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-6.textA wrangler.toml configuration file defining the project name, main entry point, compatibility date, and environment variables for a Single Page App proxy worker.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file defining the project name, main entry point, compatibility date, and environment v...
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-7.textA Cloudflare Workers script that serves a Single Page Application shell and injects bootstrap data into the response.Exact payloads, commands, or snippets shown in A Cloudflare Workers script that serves a Single Page Application shell and injects bootstrap data into the response.
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-8.textA Cloudflare Workers script implementation of a Single Page Application shell that handles static asset routing and injects bootstrap data.Exact payloads, commands, or snippets shown in A Cloudflare Workers script implementation of a Single Page Application shell that handles static asset routing and i...
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-9.textA React-based single page application shell implementation that utilizes pre-fetched bootstrap data via a global window object.Exact payloads, commands, or snippets shown in A React-based single page application shell implementation that utilizes pre-fetched bootstrap data via a global wind...
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-10.textA TypeScript implementation of a Single Page Application shell that includes a global interface for injecting bootstrap data into the window object.Exact payloads, commands, or snippets shown in A TypeScript implementation of a Single Page Application shell that includes a global interface for injecting bootstr...
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-11.textA JavaScript implementation using HTMLRewriter to inject bootstrap data into a Single Page Application shell within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript implementation using HTMLRewriter to inject bootstrap data into a Single Page Application shell within a...
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-12.textA Cloudflare Workers script that uses HTMLRewriter to inject a CSP nonce into a Single Page Application shell.Exact payloads, commands, or snippets shown in A Cloudflare Workers script that uses HTMLRewriter to inject a CSP nonce into a Single Page Application shell.
examples/workers-examples-spa-shell-single-page-app-with-bootstrap-data-cloudflar-13.textA Cloudflare Workers example demonstrating how to use HTMLRewriter to inject bootstrap configuration data into a Single Page Application shell.Exact payloads, commands, or snippets shown in A Cloudflare Workers example demonstrating how to use HTMLRewriter to inject bootstrap configuration data into a Sing...

What This Skill Covers

  • Single Page App (SPA) shell with bootstrap data
  • Main sections: Tags, Option 1: Single Page App (SPA) built entirely on Workers, Configure static assets, Inject bootstrap data with HTMLRewriter, Option 2: SPA hosted on an external origin.

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/spa-shell