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

x/ultra/lib/deps.ts>Hono

🧙 Hypermodern Zero-Legacy Deno/React Framework
Go to Latest
class Hono
Re-export
import { Hono } from "https://deno.land/x/ultra@v2.0.0-beta.9/lib/deps.ts";

Constructors

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

Type Parameters

optional
E extends Partial<Environment> = 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 extends string = string, Env extends Partial<Environment> = E>(...middleware: Handler<Path, Env>[]): Hono<Env, Path>
use<Path extends string = string, Env extends Partial<Environment> = E>(arg1: string, ...middleware: Handler<Path, Env>[]): Hono<Env, Path>