Files
SnowLuma/.pnpm-store/v11/files/b0/c1fd66c00449a23325cbe6cd41d3e477d6d9c6856c7d2faa2afc11bd47f70a355b1f5f3b5a36a15f05bda83bb7095f2dda7b819c3d60ad7e6c68353428e576
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

25 lines
670 B
Plaintext

//#region src/adapter/netlify/conninfo.ts
/**
* Get connection information from Netlify
* @param c - Context
* @returns Connection information including remote address
* @example
* ```ts
* import { Hono } from 'hono'
* import { handle, getConnInfo } from 'hono/netlify'
*
* const app = new Hono()
*
* app.get('/', (c) => {
* const info = getConnInfo(c)
* return c.text(`Your IP: ${info.remote.address}`)
* })
*
* export default handle(app)
* ```
* @deprecated `hono/netlify` will be removed in v5. Install `@hono/netlify` and import from there instead.
*/
const getConnInfo = (c) => ({ remote: { address: c.env.context?.ip } });
//#endregion
export { getConnInfo };