Skip to main content
Module

x/hono/hono-base.ts>HonoBase

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

Constructors

new
HonoBase(options?: HonoOptions<E>)

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
fetch: (
request: Request,
Env?: E["Bindings"] | { },
executionCtx?: ExecutionContext,
) => unknown
fire: () => unknown
readonly
getPath: GetPath<E>
deprecated
handleEvent: (event: FetchEventLike) => unknown
deprecated
head: () => unknown
notFound: (handler: NotFoundHandler<E>) => unknown
onError: (handler: ErrorHandler<E>) => unknown
request: (
input: RequestInfo | URL,
requestInit?: RequestInit,
Env?: E["Bindings"] | { },
executionCtx?: ExecutionContext,
) => unknown
router: Router<[H, RouterRoute]>
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>
deprecated
showRoutes()