Skip to content

HonoBackend

Defined in: src/http/backend/HonoBackend.ts:68

Hono-backed HTTP backend — a thin adapter that compiles the actor-ts routing DSL onto a Hono app and serves it with Bun.serve. Hono is a lightweight router that runs well on Bun and covers the middleware cases we usually reach for (CORS, auth, logger) without pulling in Express.

hono is an optional peer dependency: install it only if you use this backend. Without a user-supplied app, the backend imports hono dynamically on listen().

new HonoBackend(options?): HonoBackend

Defined in: src/http/backend/HonoBackend.ts:82

HonoBackendOptions = {}

HonoBackend

readonly name: "hono" = 'hono'

Defined in: src/http/backend/HonoBackend.ts:69

HttpServerBackend.name

getApp(): HonoAppLike

Defined in: src/http/backend/HonoBackend.ts:89

Inject / access the underlying Hono app — useful for native middleware.

HonoAppLike


listen(host, port): Promise<ServerBinding>

Defined in: src/http/backend/HonoBackend.ts:106

Start listening. Returns a ServerBinding with the actual bound port.

string

number

Promise<ServerBinding>

HttpServerBackend.listen


registerRoute(route): void

Defined in: src/http/backend/HonoBackend.ts:94

Register all routes before listen is called. Duplicate paths must be rejected.

RouteRegistration

void

HttpServerBackend.registerRoute


setErrorHandler(handler): void

Defined in: src/http/backend/HonoBackend.ts:102

Optionally register a global error handler.

(err, req) => HttpResponse | Promise<HttpResponse>

void

HttpServerBackend.setErrorHandler


setNotFound(handler): void

Defined in: src/http/backend/HonoBackend.ts:98

Optionally register a catch-all not-found handler.

(req) => HttpResponse | Promise<HttpResponse>

void

HttpServerBackend.setNotFound