Hono backend
Hono is a runtime-agnostic HTTP
framework — the same code runs on Bun, Node, Deno, Cloudflare
Workers, AWS Lambda, Vercel, etc. HonoBackend wraps it for
actor-ts.
import { ActorSystem, HttpExtensionId } from 'actor-ts';import { HonoBackend } from 'actor-ts/http';
const http = system.extension(HttpExtensionId);
await http.newServerAt('0.0.0.0', 8080) .useBackend(new HonoBackend()) .bind(routes);When to use Hono
Section titled “When to use Hono”Hono is the right pick when:
- Edge / serverless — Cloudflare Workers, Vercel Edge, Deno Deploy. Hono is one of the few HTTP frameworks that works in those environments.
- Cross-runtime portability — same code on Bun + Node + Edge.
- Minimal overhead — Hono is lighter than Fastify, faster than Express.
For a typical long-running production server, Fastify is usually preferable — bigger plugin ecosystem, more production hours. Hono shines when “runs in many places” is a hard requirement.
Cross-runtime + serverless caveat
Section titled “Cross-runtime + serverless caveat”// On a long-running VM: this worksawait http.newServerAt('0.0.0.0', 8080) .useBackend(new HonoBackend()) .bind(routes);
// On Cloudflare Workers: there's no "newServerAt(host, port)"// The runtime invokes a handler per request.HonoBackend exposes its underlying Hono instance:
const backend = new HonoBackend();const honoApp = backend.app; // ← export to the edge runtimeIn Cloudflare Workers:
export default { fetch: honoApp.fetch };The framework’s actor-ts side then runs in-memory inside the isolate — short-lived, no clustering, no persistence. Useful for stateless request-handling logic that benefits from actor patterns (state machines, validation pipelines).
For long-running actor systems with cluster + persistence, don’t run on edge runtimes — they’re isolate-per-request, not long-lived processes.
Configuration
Section titled “Configuration”new HonoBackend({ // Hono itself has minimal config; most settings come via routes / middleware});Hono middleware
Section titled “Hono middleware”import { logger, cors, secureHeaders } from 'hono/middleware';
const backend = new HonoBackend();await http.newServerAt('0.0.0.0', 8080) .useBackend(backend) .bind(routes);
backend.app.use('*', logger());backend.app.use('/api/*', cors());backend.app.use('*', secureHeaders());Hono’s middleware ecosystem is smaller than Express’s but covers the common cases — CORS, security headers, JWT auth, basic auth, compression.
Peer dependency
Section titled “Peer dependency”npm install hono# or: bun add honoPerformance
Section titled “Performance”Rough numbers:
- 100K-150K req/sec on Bun for trivial routes.
- Slightly slower than Fastify on Node.
- Edge runtime numbers depend on the platform (Cloudflare Workers: ~50K req/sec per worker; throttled by the platform).
Edge runtime caveats
Section titled “Edge runtime caveats”Where to next
Section titled “Where to next”- HTTP overview — the bigger picture.
- Fastify backend — for Node / Bun production servers.
- Express backend — for Express-middleware-rich apps.
- Hono docs — Hono’s own documentation.