Anatomy

How this site is wired

Static export plus one edge function — the smallest setup that still exercises the parts of Cloudflare Pages worth testing.

Files that matter

app/

Next.js App Router pages. Every route is prerendered to static HTML by next build.

next.config.mjs

output: 'export' turns the build into a plain ./out folder — no Node server needed.

functions/api/hello.js

A Cloudflare Pages Function. Lives outside the Next build and is deployed straight to the Workers runtime at /api/hello.

public/_headers

Custom response headers applied by the Cloudflare CDN.

public/_redirects

Redirect rules — /old-page sends you back to /.

.node-version

Pins the Node version the Pages build container uses.

app/not-found.js

Exported as 404.html, which Pages serves for unknown paths.

Cloudflare build settings

Framework presetNone (the Next.js preset still injects a removed next export step)
Build commandnpm run build
Output directoryout
Root directoryleave empty

Back to the checks