Streaming SSR
React Server Components render per request inside the Worker. Static shells are served by Workers Static Assets.
app/page.tsxWorkers runtime
Next.js 15.5 × Cloudflare Workers
A production-shaped Next.js starter that compiles into a single Cloudflare Worker. Server rendering, typed API routes and static assets — all answered by the edge city nearest to the visitor.
01 / LIVE EDGE
This panel is server-rendered on the first hop, then refreshed by a route handler running on the same Worker. Nothing is stored.
Nearest colo
CMH
Values come from Cloudflare request headers: cf-ray, cf-ipcountry and cf-connecting-ip. Outside Cloudflare they fall back to LOCAL.
02 / REQUEST PATH
There is no origin server behind this page. The Worker is the server, and it runs in the same location that terminates TLS.
A browser asks for /api/edge. DNS resolves to the closest Cloudflare location.
TLS terminates at the colo. Cloudflare annotates the request with cf-ray, country and client IP.
The Next.js server bundle runs inside workerd. Route handlers and React Server Components execute here.
JSON or streamed HTML travels back from the same city. No origin server sits in the middle.
03 / WHAT'S INSIDE
A deliberately small set of primitives, wired the way the platform expects them.
React Server Components render per request inside the Worker. Static shells are served by Workers Static Assets.
app/page.tsxThe route handler reads Cloudflare's request headers and returns a typed snapshot of colo, country and client.
app/api/edge/route.tsOpenNext turns next build into a Worker bundle; Wrangler uploads the script and its assets in one command.
npm run deploy04 / SHIP IT
Local development runs on Node. Production runs on workerd. The same source, two runtimes.
$ npm install
$ npm run dev # localhost:3000
$ npm run deploy # build + upload
↳ cloudflareworkers-me.workers.dev
Deploys need a Cloudflare API token with Workers Scripts: Edit. Export CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID, or run wrangler login on the machine that ships.
The Worker name and compatibility date live in wrangler.jsonc. The adapter entry point is open-next.config.ts.