Hono is the fastest web framework for the edge, designed to run anywhere - Cloudflare Workers, Deno, Bun, Node.js, and more.
Getting Started
import { Hono } from "hono";
const app = new Hono();
app.get("/", (c) => c.text("Hello Hono!"));
app.get("/api/users/:id", (c) => {
const id = c.req.param("id");
return c.json({ id, name: "User " + id });
});
export default app;
Middleware
import { cors } from "hono/cors";
import { logger } from "hono/logger";
import { jwt } from "hono/jwt";
app.use("*", logger());
app.use("/api/*", cors());
app.use("/api/*", jwt({ secret: process.env.JWT_SECRET }));
Deploy Anywhere
# Cloudflare Workers
wrangler deploy
# Deno Deploy
deno deploy
# Bun
bun run src/index.ts
Performance
Hono benchmarks show impressive results:
- Cloudflare Workers: ~150k req/s
- Bun: ~200k req/s
- Node.js: ~80k req/s
Comments (0)
Leave a Comment
No comments yet. Be the first to share your thoughts!