hub-hono-minimal
The minimal Hono host for @devframes/hub: one initHub() call behind a catch-all route, running on Node and Bun from the same app file, the UI supplied by @devframes/hub-ui.
Package: hub-hono-minimal · framework: Hono
What it shows
initHub({ base, devframes: [inspect, messages], ui: createUi() })insrc/app.tsplusapp.all(\${hub.base}*`, c => hub.handler(c.req.raw)). No transport option, so each runtime's entry wires the socket its own way — both landing on${hub.base}__ws`, the app's own origin.- On Node (
src/server.ts),@hono/node-server'sserve()returns thenode:httpserver andhub.attach(server)takes its upgrade events. - On Bun (
src/bun.ts), upgrades arrive as fetch requests, so the entry binds Bun's transport withcreateContextRpcServer+attachBunWsTransportinsideBun.serve({ fetch, websocket }). The repo'sscripts/smoke-bun.tsexercises this path end to end.
Run it
sh
pnpm install
pnpm --filter hub-hono-minimal dev # Node
pnpm --filter hub-hono-minimal dev:bun # Bun