Skip to main content
Module

x/hono/mod.ts>Context

Ultrafast web framework for the Edge
Extremely Popular
Go to Latest
class Context
import { Context } from "https://deno.land/x/hono@v3.1.2/mod.ts";

Constructors

new
Context(req: Request, options?: ContextOptions<E>)

Type Parameters

optional
E extends Env = any
optional
P extends string = any
optional
I extends Input = { }

Properties

private
_executionCtx: FetchEvent | ExecutionContext | undefined
private
_headers: Headers | undefined
private
_map: Record<string, unknown> | undefined
private
optional
_paramData: Record<string, string> | null
private
_path: string
private
_preparedHeaders: Record<string, string> | undefined
private
_pretty: boolean
private
_prettySpace: number
private
optional
_req: HonoRequest<any, any>
private
_res: Response | undefined
private
_status: StatusCode
private
notFoundHandler: NotFoundHandler<E>
private
optional
rawRequest: Request | null
body: BodyRespond
env: E["Bindings"]
error: Error | undefined
readonly
event: FetchEvent
readonly
executionCtx: ExecutionContext
finalized: boolean
get: <Key extends keyof E["Variables"] | keyof ContextVariableMap>(key: Key) => GetVariable<Key, E>
header: (
name: string,
value: string,
options?: { append?: boolean; },
) => void
html: HTMLRespond
json: JSONRespond
jsonT: JSONTRespond
newResponse: NewResponse
notFound: () => Response | Promise<Response>
pretty: (prettyJSON: boolean, space?: number) => void
redirect: (location: string, status?: StatusCode) => Response
readonly
req: HonoRequest<P, I["out"]>
readonly
runtime: Runtime
set: <Key extends keyof E["Variables"] | keyof ContextVariableMap>(key: Key, value: GetVariable<Key, E>) => void
status: (status: StatusCode) => void
text: TextRespond