Skip to content

助手工具

¥Helpers

辅助程序可用于协助开发你的应用。与中间件不同,它们不充当处理程序,而是提供有用的功能。

¥Helpers are available to assist in developing your application. Unlike middleware, they don't act as handlers, but rather provide useful functions.

例如,以下是如何使用 Cookie 助手

¥For instance, here's how to use the Cookie helper:

ts
import { getCookie, setCookie } from 'hono/cookie'

const app = new Hono()

app.get('/cookie', (c) => {
  const yummyCookie = getCookie(c, 'yummy_cookie')
  // ...
  setCookie(c, 'delicious_cookie', 'macha')
  //
})

可用助手

¥Available Helpers

Hono v4.7 中文网 - 粤ICP备13048890号