Astro
Cloudflare adapter
Cloudflare adapter is the Astro adapter that builds your on-demand routes into a Cloudflare Worker. Static files are served from the platform's asset layer.
How it is measured
Add @astrojs/cloudflare and set it in the config. The build writes a Worker entry and a folder of static assets. Bindings such as KV, D1, and R2 are declared in the Wrangler config and read through the runtime.
Test with the local Wrangler preview before deploying, because the Worker runtime is not Node. A package that reads the filesystem or uses a missing Node module will fail there, not in astro dev.
Worked example
A surf-report site stores wave readings in a D1 database. One on-demand route queries the last 24 hours and returns a page. The Worker answers in 38 ms from the nearest edge, and the 120 static pages never touch it.
The team tries to use a image library that needs native binaries. The Worker bundle refuses to build, so they switch to build-time processing.
How it differs
The Cloudflare adapter targets Workers. The Node adapter emits a long-running server. Cloudflare excludes the Node filesystem and long processes; Node excludes global edge placement unless you run it yourself.
Common errors
Assuming every Node package works. Reading environment variables the wrong way for the runtime. Forgetting to declare a binding. Skipping local Wrangler preview. Exceeding Worker size or CPU limits with a large dependency.
In practice
Run the Wrangler preview as part of your check before each deploy. Keep heavy work at build time. List your bindings in one place and name them clearly.