Skip to content

Hono

Hono is a fast and lightweight web application framework, built on Web Standards.

Hono is compatible out of the box with fetch handlers (like on Cloudflare, Netlify, Vercel or Node):

src/handler.ts
import type { ExportedHandler } from "@vite-deploy/netlify";
import { Hono } from "hono";
const app = new Hono();
// ...
export default app satisfies ExportedHandler;

If you want to use Hono with a Node handler, you will need to convert the fetch handler to a Node handler. We recommend srvx:

src/server.ts
import mod from "./handler";
import { toNodeHandler } from "srvx/node";
import * as http from "node:http";
import sirv from "sirv";
import { fileURLToPath } from "node:url";
const server = http.createServer((req, res) =>
sirv(fileURLToPath(new URL("../client/", import.meta.url)), { dev: true })(
req,
res,
() => {
// @ts-expect-error
toNodeHandler(mod.fetch)(req, res);
},
),
);
server.listen(3000, () => {
console.log("Ready at http://localhost:3000");
});