Wrangler and Miniflare — Build Locally, Ship Globally
Hoplink is about to grow a new feature: letting people attach files to short links. Before touching storage, you need a comfortable loop for writing, running and deploying code. Editing in the dashboard works for a demo, but real projects live in a folder, in Git, driven from the terminal.
The rule
Create, dev, deploy — local first, real network last.
Wrangler is Cloudflare's command-line tool. Four commands carry most of the load:
npm create cloudflare@latest hoplink # scaffold a new project
npx wrangler dev # run it on your machine
npx wrangler deploy # publish to the whole network
npx wrangler tail # stream live logs from production- Create. The scaffolding tool writes
wrangler.jsonc, asrc/entry file andpackage.json, and can set up TypeScript and a framework such as Hono. - Dev.
wrangler devserves your Worker athttp://localhost:8787. It runs on Miniflare, a local simulator built onworkerd, the same open-source runtime that powers production Workers. Your KV, R2, D1, Durable Objects and queues are simulated too, stored under.wrangler/statein the project folder. Nothing you do locally touches real data. - Deploy.
wrangler deploybundles your code, uploads it with the bindings from your config, and it is live worldwide within seconds. - Observe.
wrangler tailshowsconsole.logoutput and errors from real traffic;wrangler devalso offers a DevTools inspector for breakpoints.
Resources are created from the same tool: wrangler kv namespace create LINKS, wrangler r2 bucket create hop-files, wrangler d1 create hop-db. Each command prints the config snippet to paste into wrangler.jsonc.
In a team, wrangler deploy usually runs from CI rather than a laptop: a pipeline installs dependencies, runs tests, and deploys with an API token stored as a CI secret.