import { Context } from "https://deno.land/x/hono@v4.1.1/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: ExecutionContextredirect: (location: string, status?: RedirectStatusCode) => Response
.redirect()
can Redirect, default status code is 302.
res: Response
readonly
var: Readonly<ContextVariableMap & (IsAny<E["Variables"]> extends true ? Record<string, any> : E["Variables"])>.var
can access the value of a variable.