liveastrocloudflaretypescript
This site
Astro on Cloudflare Workers — static pages, on-demand API routes, one deploy.
The site you’re reading. Static pages are prerendered at build time and served
straight from Cloudflare’s asset layer; anything under /api/ opts out with
prerender = false and runs on demand in the same Worker.
Why one Worker
Bindings. Workers AI, D1, KV, and R2 are all reachable from an API route through
import { env } from 'cloudflare:workers' — no fetch to a separate service, no
second deploy target, no CORS.
Stack
- Astro — content collections for the blog, MDX for interactive posts
- Tailwind v4 — via the Vite plugin, configured in CSS rather than JS
- Cloudflare Workers — static assets plus on-demand routes