@samveys/hono

Versi
1.0.35 Nov 2026
Pasang
pnpm add @samveys/hono

Dari packages/hono/README.md di repository framework.

Halaman ini belum diterjemahkan. Kamu sedang membaca versi bahasa Inggris.

HTTP driver for @samveys/http on Hono served by @hono/node-server. Hono carries the transport; the Samveys kernel owns every request through kernel.fetch: routing, bodies, limits, compression and errors. An app behaves the same on node, fastify and hono.

hono and @hono/node-server are peer dependencies: install the versions you want next to this package.

Use it

ts
import { createHttpServer } from '@samveys/http'
import { hono } from '@samveys/hono'

const server = await createHttpServer(app, { driver: hono(), host: '0.0.0.0', port: 3000 })
await server.listen()

Options

hono({ configure }) runs configure(app) on the Hono app before the catch-all route is added, so you can register Hono middleware. Every request still ends in the kernel.

ts
import { hono } from '@samveys/hono'

export const driver = hono({
  configure: (app) => {
    app.use('*', async (_context, next) => {
      await next()
    })
  },
})

console.log(driver.name, driver.streaming)

driver.native is the Hono app once listening (undefined before). WebSocket upgrades reach the http:upgrade listener through the same driver.upgrade(kernel) hook the node driver uses.

Conformance

The driver passes the whole @samveys/http/conformance suite, and a shared sample app returns identical statuses, bodies and key headers on node, fastify and hono.