0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/examples/react/start-basic-cloudflare
github-actions[bot] 6b9fe6d295
ci: Version Packages (#8745)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
History 2026-10-22 22:05:39 +02:00
..
.devcontainer docs: add devcontainer.json to all e2e/examples (#6972) 2026-03-18 15:43:14 +01:00
.vscode examples: Add start-basic-cloudflare example (#5254) 2025-09-26 22:07:02 +02:00
public examples: Add start-basic-cloudflare example (#5254) 2025-09-26 22:07:02 +02:00
src chore: regenerate route trees (#7853) 2026-07-19 09:20:56 +02:00
.gitignore examples: Add start-basic-cloudflare example (#5254) 2025-09-26 22:07:02 +02:00
.prettierignore examples: Add start-basic-cloudflare example (#5254) 2025-09-26 22:07:02 +02:00
package.json ci: Version Packages (#8745) 2026-10-22 22:05:39 +02:00
README.md docs(examples): standardize the READMEs for the React examples (#6014) 2025-12-07 01:39:44 +13:00
tsconfig.json chore: upgrade tooling to typescript 6 (#7024) 2026-03-23 22:59:52 +01:00
vite.config.ts docs: update examples/e2e to vite 8 (#6958) 2026-03-17 20:37:11 +01:00
worker-configuration.d.ts docs: update examples/e2e to vite 8 (#6958) 2026-03-17 20:37:11 +01:00
wrangler.jsonc examples: Add start-basic-cloudflare example (#5254) 2025-09-26 22:07:02 +02:00

TanStack Start - Cloudflare Example

A TanStack Start example demonstrating deployment to Cloudflare Workers.

Start a new project based on this example

To start a new project based on this example, run:

npx gitpick TanStack/router/tree/main/examples/react/start-basic-cloudflare start-basic-cloudflare

Getting Started

From your terminal:

pnpm install
pnpm dev

This starts your app in development mode, rebuilding assets on file changes.

Build

To build the app for production:

pnpm build

Preview

To preview the production build locally:

pnpm preview

Deploy to Cloudflare

To deploy your app to Cloudflare Workers:

pnpm run deploy

Accessing Cloudflare Bindings

You can access Cloudflare bindings in server functions by using importable env:

import { env } from 'cloudflare:workers'

See src/routes/index.tsx for an example.

Cloudflare Configuration

This example includes:

  • Wrangler configuration for Cloudflare Workers
  • Type generation for Cloudflare bindings
  • Server-side rendering on the edge
  • Access to Cloudflare platform features (KV, D1, R2, etc.)