~/VibeHandbook
$39

Cloudflare

developers.cloudflare.com

Cloudflare Pages

What it is

Cloudflare Pages is a hosting platform for websites — from plain static files to full-stack apps. You connect a Git repository, Pages runs your build command, and it serves the output from Cloudflare's CDN. Dynamic routes and APIs run as Pages Functions, which are Workers under the hood, so a single project can be both a static site and a backend.

Strengths

  • Git-driven: every push builds and deploys, with a preview URL per branch.
  • Static assets are served fast and free from the global CDN.
  • Pages Functions add server-side logic with the same bindings as Workers (D1, R2, KV).
  • Generous free tier and unlimited bandwidth.
  • Rollbacks are one click — every deploy is preserved.

Trade-offs

  • The build environment has time and resource limits; very large builds can be slow.
  • Functions inherit the Workers runtime, so the same non-Node constraints apply.
  • For purely dynamic, always-on backends, plain Workers may be a cleaner fit.
  • Build configuration for less common frameworks sometimes needs manual tuning.

When to use it

Use Pages for marketing sites, docs, blogs, SPAs, and full-stack frameworks (Next.js, Astro, SvelteKit) where you want Git-based deploys, free static hosting, and optional server functions in one place.

Vibe coding fit

Pages suits vibe coding because the whole deploy is "connect a repo and push." An agent can set the build command, output directory, and environment variables, then deploy with Wrangler or trigger a Git build. Tip: tell the agent your framework and whether you need Functions, so it picks the right adapter and output directory. You can also deploy a prebuilt directory directly.

# wrangler.toml — Pages project config
name = "my-site"
pages_build_output_dir = "dist"

[[d1_databases]]
binding = "DB"
database_name = "my-db"
database_id = "your-d1-id"
# Deploy a prebuilt output directory
npx wrangler pages deploy dist --project-name my-site