HonoBackend
Este conteúdo não está disponível em sua língua ainda.
Defined in: src/http/backend/HonoBackend.ts:78
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().
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HonoBackend(
options?):HonoBackend
Defined in: src/http/backend/HonoBackend.ts:92
Parameters
Section titled “Parameters”options?
Section titled “options?”HonoBackendOptions = {}
Returns
Section titled “Returns”HonoBackend
Properties
Section titled “Properties”
readonlyname:"hono"='hono'
Defined in: src/http/backend/HonoBackend.ts:79
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”getApp()
Section titled “getApp()”getApp():
HonoAppLike
Defined in: src/http/backend/HonoBackend.ts:99
Inject / access the underlying Hono app — useful for native middleware.
Returns
Section titled “Returns”HonoAppLike
listen()
Section titled “listen()”listen(
host,port):Promise<ServerBinding>
Defined in: src/http/backend/HonoBackend.ts:116
Start listening. Returns a ServerBinding with the actual bound port.
Parameters
Section titled “Parameters”string
number
Returns
Section titled “Returns”Promise<ServerBinding>
Implementation of
Section titled “Implementation of”registerRoute()
Section titled “registerRoute()”registerRoute(
route):void
Defined in: src/http/backend/HonoBackend.ts:104
Register all routes before listen is called. Duplicate paths must be rejected.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”HttpServerBackend.registerRoute
setErrorHandler()
Section titled “setErrorHandler()”setErrorHandler(
handler):void
Defined in: src/http/backend/HonoBackend.ts:112
Optionally register a global error handler.
Parameters
Section titled “Parameters”handler
Section titled “handler”(err, req) => HttpResponse | Promise<HttpResponse>
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”HttpServerBackend.setErrorHandler
setNotFound()
Section titled “setNotFound()”setNotFound(
handler):void
Defined in: src/http/backend/HonoBackend.ts:108
Optionally register a catch-all not-found handler.
Parameters
Section titled “Parameters”handler
Section titled “handler”(req) => HttpResponse | Promise<HttpResponse>
Returns
Section titled “Returns”void