#cloudflare #workers #polls

Cloudflare Workers as Glue

Polls, gate, and Munshi sit on Workers + D1 — not because Pages failed, but because state has to live at the edge.

Static Astro sites cover most of too.foo. The exceptions need request-time logic: signed invite links, OAuth callbacks, webhook ingestion.

Polls

Each invite carries a token that records who shared with whom. After gate.too.foo auth, the Worker writes to D1 and renders the share-tree tally. That cannot be a static export.

Deploy path

tools/deploy.sh polls targets the sibling Worker repo (polls-too-foo), not a Pages dist/. The manifest’s deploy.kind: cf-worker tells the script which toolchain to run.

Lesson

Reach for Workers when the interesting behavior is per-request mutation. Reach for Pages when the artifact is HTML you can grep-verify after deploy.