wrangler dev serves local R2 objects at a public URL
Introduced 2026-06-11 · score 0.95
HOW TO USE IT
When testing a Worker with a local R2 binding, request the object from the running `wrangler dev` server at `/cdn-cgi/local/r2/public/<bucket-id>/<key>`. Use `bucket_name` as `<bucket-id>` when set, otherwise the binding; `remote: true` bindings are not exposed.
curl http://localhost:8787/cdn-cgi/local/r2/public/<bucket-id>/<key>WHY THIS HELPS
When testing a Worker locally that serves objects from a local R2 binding, request an object through the dev server’s public-bucket route.
REQUIREMENTS AND LIMITATIONS
- Version: 4.100.0
- <bucket-id> (required): Use the binding’s `bucket_name` when set; otherwise use its `binding`.
- <key> (required): Object key appended to the local public-bucket route.
- Prerequisite: Run `wrangler dev` locally; by default it uses a local R2 simulation.
- Only local R2 bindings are exposed; bindings configured with `remote: true` are not exposed.
FIRST-PARTY EVIDENCE
- https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.100.0
- https://developers.cloudflare.com/r2/get-started/workers-api/
Check the installed version and the source before using it. Entry JSON