Skip to content

Hono

Use the Hono utility when Zelavis should be mounted into an existing Hono application.

import { Hono } from "hono";
import { serve } from "@hono/node-server";
import { Zelavis } from "zelavis";
import { nodeAdapter } from "zelavis/adapters/node";
import { honoMiddleware } from "zelavis/hono";
const app = new Hono();
const zv = new Zelavis({ adapter: nodeAdapter() });
app.use(honoMiddleware(zv));
serve({ fetch: app.fetch, port: 3000 });
import { Hono } from "hono";
import { Zelavis } from "zelavis";
import { bunAdapter } from "zelavis/adapters/bun";
import { honoMiddleware } from "zelavis/hono";
const app = new Hono();
const zv = new Zelavis({ adapter: bunAdapter() });
app.use(honoMiddleware(zv));
Bun.serve({
port: 3000,
fetch: app.fetch,
});
honoMiddleware(zv: Zelavis): MiddlewareHandler
  • Hono apps running on Node.js or Bun
  • Apps that already use Hono middleware and route composition
  • Cases where Zelavis should share an app with custom Hono endpoints