Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/hono/mod.ts>Hono

Ultrafast web framework for Cloudflare Workers, Deno, and Bun. Fast, but not only fast.
Very Popular
Go to Latest
class Hono
Re-export
import { Hono } from "https://deno.land/x/hono@v2.1.0/mod.ts";

Constructors

new
Hono(init?: Partial<Pick<Hono, "router" | "strict">>)

Type Parameters

optional
E extends { Bindings?: Bindings; Variables?: Variables; } = Environment
optional
P extends string = "/"

Properties

private
_tempPath: string
private
errorHandler: ErrorHandler
private
notFoundHandler: NotFoundHandler
private
path: string
fetch: (
request: Request,
Environment?: E["Bindings"],
executionCtx?: ExecutionContext,
) => unknown
readonly
router: Router<Handler<string, E>>
routes: Route<E>[]
readonly
strict: boolean

Methods

private
addRoute(
method: string,
path: string,
handler: Handler<string, E>,
): void
private
dispatch(
request: Request,
eventOrExecutionCtx?: ExecutionContext | FetchEvent,
env?: E["Bindings"],
): Promise<Response>
private
matchRoute(method: string, path: string)
handleEvent(event: FetchEvent): Promise<Response>
notFound(handler: NotFoundHandler): Hono<E, P>
onError(handler: ErrorHandler): Hono<E, P>
request(input: RequestInfo, requestInit?: RequestInit): Promise<Response>
route(path: string, app?: Hono<any>): Hono<E, P>
use(path: string, ...middleware: Handler<string, E>[]): Hono<E, P>
use(...middleware: Handler<string, E>[]): Hono<E, P>