What this demonstrates
- Static hosting: This page, styles, images.
- Pages Functions: Simple JSON API and dynamic route.
- Redirects: Via
_redirects(try /old-path → /docs). - Headers: Security and cache headers via
_headers. - Custom errors:
404.html,500.html. - Zero-touch deploy: CI workflow and one-command deploy script.
See the docs for details and free-tier limits.
Live demos
API: /api/time
(click the button)
Dynamic route: /hello/:name
(submit the form)
Request headers
Middleware adds x-request-id. Open DevTools → Network to see response headers.
Edit and redeploy with one request
With the included CI and deploy script, a single request from a Cursor background agent can edit files in this repo and deploy to Cloudflare Pages without confirmation.
- Agent edits files (like this page).
- Agent runs
npm run deploywith Cloudflare credentials set as env vars. - Deployment completes and preview/production URLs update automatically.