Hono is a web framework built on the Web Fetch API, which means the same router and middleware run unchanged on Cloudflare Workers, Bun, Deno, Node.js, and AWS Lambda. It's small (around 14KB), has zero dependencies, and ships with first-class TypeScript support including full type inference for route params, query strings, and validated request bodies. Cloudflare uses it internally for parts of its own product surface.
That combination matters in 2026: edge runtimes are now the default target for new APIs, and Hono treats "runs everywhere" as a core design goal rather than an afterthought.
I wrote a full walkthrough that builds a real REST API from scratch, and this post covers what's inside it.
What the guide builds
The tutorial goes from npm create hono@latest to a deployed, validated, JWT-protected API on Cloudflare's edge network. It covers:
-
Project setup with create-hono picking the
cloudflare-workerstemplate and understanding the context object (c) that every handler receives. -
Your first routes handling path params, query strings, and JSON bodies with
c.req.param(),c.req.query(), andawait c.req.json(). -
Middleware built-in
logger(),cors(), andtiming(), plus writing your own with thec, nextshape and route-level scoping likeapp.use('/api/*', cors()). -
Input validation with Zod using
@hono/zod-validatorto parse and type request bodies in one step, with automatic400responses on failure. -
JWT authentication using the built-in
hono/jwtmiddleware to sign tokens and protect routes, reading secrets fromc.envrather than hardcoding them. - Organizing a real API with app.route() splitting users, posts, and comments into separate sub-apps that each keep their own routes and middleware.
-
Deploying to Cloudflare Workers with
wrangler deploy, configuringwrangler.toml, and storing secrets encrypted viawrangler secret put. -
Deploying to Node.js instead swapping only the entry point with
@hono/node-server, leaving every route and validator untouched. - Hono vs Express an honest comparison of bundle size, TypeScript support, edge runtime support, and when each one is the right default.
The short version
npm create hono@latest my-api
# pick the cloudflare-workers template
cd my-api && npm install && npm run dev
A minimal app looks like this:
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => {
return c.json({ message: 'Hello Hono!' })
})
export default app
The same app object you build runs unchanged on Node.js if you need that flexibility later. Only the entry point changes, never the routes, middleware, or validators.
Read the full tutorial
The complete guide has working code for every step, a Hono vs Express comparison table, and an FAQ covering performance, Node.js support, and Zod validation behavior:
👉 Hono.js Tutorial: REST API with Zod, JWT & Cloudflare Workers
If you're building something new for the edge in 2026, Hono is worth a serious look.
Top comments (0)