Skip to main content
hobun

How it works

One app, four lives

The same Hono app drives development, the build, the preview, and the deployed site: four roles, learned one piece at a time.

  1. 01 · Dev

    Bun serves the app directly

    bun run dev

    Bun detects the app's fetch and serves it. --hot re-evaluates the code on every save, and a small script polls a hash endpoint to reload the browser. Dev behaves like production: same routes, same security headers.

  2. 02 · Build

    toSSG bakes every route to a file

    bun run build

    scripts/build.ts clears dist/, runs toSSG from hono/bun, and copies public/ over. Bun transpiles the TSX at runtime; there is no compile step and no bundler.

  3. 03 · Preview

    Wrangler reproduces the Pages shape

    bun run preview

    wrangler pages dev dist is the only tool that serves the built output with real Pages semantics: genuine 404s, _headers applied, the 404.html fallback working.

  4. 04 · Deploy

    Pages runs the build and serves the files

    git push

    Cloudflare Pages' Git integration runs bun run build on every push and serves dist/ from the edge. Pages understands _headers and 404.html natively; nothing else is needed.