Cloudflare Pages Pages

A plain HTML site with no build step, plus /functions for server code. Deployed with wrangler pages deploy.

1. File-based routing (Pages Functions)

functions/api/hello.ts becomes GET /api/hello, and functions/api/greet/[name].ts becomes /api/greet/:name.


  

2. Bindings: a KV namespace shared with the Worker

This project binds the same KV namespace as the lab Worker. Bindings are declared in pages-demo/wrangler.jsonc, just like a Worker.


  

3. Service binding to the lab Worker

functions/api/lab/[[path]].ts forwards to the cf-feature-lab Worker via env.LAB.fetch(). That's a direct Worker-to-Worker call with no public internet hop.


  

4. _headers and _redirects

Two plain-text files in the output folder control headers and redirects with no code.