import { Context } from "https://dotland.deno.dev/x/hono@v4.2.6/mod.ts";
Constructors
new
Context(req: HonoRequest<P, I["out"]>, options?: ContextOptions<E>)Properties
private
_var: E["Variables"]private
notFoundHandler: NotFoundHandler<E>.body()
can return the HTTP response.
You can set headers with .header()
and set HTTP status code with .status
.
This can also be set in .text()
, .json()
and so on.
env: E["Bindings"]
.env
can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers.
readonly
executionCtx: ExecutionContextreadonly
var: Readonly<ContextVariableMap & (IsAny<E["Variables"]> extends true ? Record<string, any> : E["Variables"])>.var
can access the value of a variable.