Skip to content

context | 上下文

ts
app.get("/hello", (c) => {
  // c 就是 context
});

c.req 是 HonoRequest

c.error

错误对象会被放置在 c.error 中

todo 实测

c.ContextVariableMap

用于中间件使用的变量,为其添加类型定义

c.render

SSR 返回 html 相关

https://honodev.pages.dev/zh/docs/api/context#render-setrenderer

c.executionCtx

ExecutionContext

c.event

todo