Skip to content

Hono

reference
1 min readUpdated

Kind: Class

Source: src/hono.ts

The Hono class extends the functionality of the HonoBase class. It sets up routing and allows for custom options to be passed.

Hono extends HonoBase and creates an application instance with routing support. Use it to register request handlers, configure application options, and route incoming requests to matching handlers.

Extends: HonoBase

Diagram

mermaid
graph LR
  Request[Incoming Request] --> Hono[Hono]
  Hono --> HonoBase[HonoBase]
  Hono --> Router[Router]
  Router --> Handler[Route Handler]
  Handler --> Response[Response]

Usage

ts
import { Hono } from 'hono'

const app = new Hono()

app.get('/', (c) => {
  return c.text('Hello from Hono')
})

export default app

AI Coding Instructions

  • Create application instances with new Hono() before registering routes or middleware.
  • Register routes through the Hono instance so requests pass through its configured router.
  • Pass supported options to the constructor when application-level routing behavior must be configured.
  • Keep route handlers focused on creating responses through the request context.
  • Preserve the HonoBase inheritance path when changing application setup behavior.

Relationships

  • IMPORTS → HonoOptions

Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (1)

  • CreateHandlersInterfacesrc/helper/factory/index.ts:20

Was this page helpful?

Download as PDF
Hono — Hono (narrator proof)