Skip to content
Myr

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 file

Take it

feat(adapters): add the seven adapters as workspace packages (#5463)Yusuke Wadabefore adoptionb877827

lines 1–15why, one step back
1import type { Context } from 'hono'
2import type { GetConnInfo } from 'hono/conninfo'3import type { CloudFrontEdgeEvent } from './handler'45type Env = {6 Bindings: {7 event: CloudFrontEdgeEvent8 }9}1011export const getConnInfo: GetConnInfo = (c: Context<Env>) => ({12 remote: {13 address: c.env.event.Records[0].cf.request.clientIp,14 },15})