Typorithm · medium

Hono

hono-basicsnodejshonoedgeweb-standards
Saved on this device
Full lesson · 8 learning steps Open any exercise for focused practice
1

Step 1 of 8 · intro card

Learn Hono

0%

Web Frameworks

Hono is an ultrafast, tiny framework built on Web Standards that runs on Node, Bun, Deno, Cloudflare Workers and the edge. A single context object c carries the request and response helpers, middleware composes cleanly, and TypeScript is first-class — ideal for edge and serverless.

Hono is a tiny, ultrafast web framework built on Web Standards (the Fetch Request and Response). Because it targets the standard, the same app runs on Node, Bun, Deno, and Cloudflare Workers.

Handlers receive a single context object, conventionally c, that bundles the request (c.req) and response helpers (c.json, c.text). You read a route param with c.req.param("id").

Middleware composes around handlers, TypeScript support is first-class, and exporting the app as the default makes it the entry point edge and serverless runtimes invoke.

01

Built on Web Standards; runs on Node, Bun, Deno, and the edge.

02

One context object c holds request and response helpers.

03

First-class TypeScript; great for edge and serverless.

import { Hono } from "hono";
const app = new Hono();
app.get("/users/:id", (c) => {
  return c.json({ id: c.req.param("id") });
});
export default app;

Read the implementation

Connect each part of the code to the concept before you type.

1. Import Hono

Hono is an ultrafast, tiny framework built on Web Standards, imported as a named export.

import { Hono } from "hono";

2. Create the app

new Hono() constructs the app instance you attach routes and middleware to.

const app = new Hono();

3. Context object

A single context object c carries both the request and the response helpers.

app.get("/users/:id", (c) => {

4. Read a param

c.req.param reads a route param and c.json builds a JSON Response.

return c.json({ id: c.req.param("id") });

5. Export the app

Exporting the app as default lets edge runtimes like Cloudflare Workers pick it up.

export default app;

A complete learning loop

01

Understand

Read the concept map and follow the code breakdown.

02

Reconstruct

Type the implementation, repair mistakes and work through every recall exercise.

03

Verify

Use the final check without hints; revisit weak concepts in short practice sessions.

Hono: Lesson & Practice · Typorithm | ApplyDjinn