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

x/hono/hono-base.ts>HonoBase

Lightweight, Ultrafast, Web Standards
Extremely Popular
Go to Latest
class HonoBase
import { HonoBase } from "https://deno.land/x/hono@v3.7.1/hono-base.ts";

Constructors

new
HonoBase(init?: Partial<Pick<Hono, "router" | "getPath"> & { strict: boolean; }>)

Type Parameters

optional
E extends Env = Env
optional
S extends Schema = { }
optional
BasePath extends string = "/"

Properties

private
_basePath: string
private
errorHandler: ErrorHandler
private
notFoundHandler: NotFoundHandler
private
path: string
fetch: (
request: Request,
Env?: E["Bindings"] | { },
executionCtx?: ExecutionContext,
) => unknown
fire: () => unknown
readonly
getPath: (request: Request, options?: { env?: E["Bindings"]; }) => string
deprecated
handleEvent: (event: FetchEventLike) => unknown
head: () => unknown
request: (
input: RequestInfo | URL,
requestInit?: RequestInit,
Env?: E["Bindings"] | { },
executionCtx?: ExecutionContext,
) => unknown
router: Router<H>
readonly
routerName
routes: RouterRoute[]

Methods

private
addRoute(
method: string,
path: string,
handler: H,
)
private
clone(): Hono<E, S, BasePath>
private
dispatch(
request: Request,
executionCtx: ExecutionContext | FetchEventLike | undefined,
env: E["Bindings"],
method: string,
): Response | Promise<Response>
private
handleError(err: unknown, c: Context<E>)
private
matchRoute(method: string, path: string)
basePath<SubPath extends string>(path: SubPath): Hono<E, S, MergePath<BasePath, SubPath>>
mount(
path: string,
applicationHandler: (request: Request, ...args: any) => Response | Promise<Response>,
optionHandler?: (c: Context) => unknown,
): Hono<E, S, BasePath>
route<SubPath extends string, SubEnv extends Env, SubSchema extends Schema, SubBasePath extends string>(path: SubPath, app: Hono<SubEnv, SubSchema, SubBasePath>): Hono<E, MergeSchemaPath<SubSchema, MergePath<BasePath, SubPath>> & S, BasePath>
route<SubPath extends string>(path: SubPath): Hono<E, RemoveBlankRecord<S>, BasePath>