conninfo.ts
This file
Path
adapters/lambda-edge/src/conninfo.ts
15 lines 路 345 bytes 路 TypeScript
Last changed by
feat(adapters): add the seven adapters as workspace packages (#5463)Yusuke Wadabefore adoptionb877827
History of this fileTake it
12345678910111213141516import type { Context } from 'hono'import type { GetConnInfo } from 'hono/conninfo'import type { CloudFrontEdgeEvent } from './handler'
type Env = { Bindings: { event: CloudFrontEdgeEvent }}
export const getConnInfo: GetConnInfo = (c: Context<Env>) => ({ remote: { address: c.env.event.Records[0].cf.request.clientIp, },})