File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 11import { Application , Context , MemoryRequest , MemoryResponse } from '@curveball/core' ;
22import qs from 'querystring' ;
3- import { AwsLambdaHandler , AwsRequest , AwsResponse } from './types' ;
3+ import { AwsContext , AwsLambdaHandler , AwsRequest , AwsResponse } from './types' ;
44import { convertBody , convertHeaders } from './util' ;
55
66export default function lambdaHandler ( app : Application ) : AwsLambdaHandler {
@@ -14,7 +14,8 @@ export default function lambdaHandler(app: Application): AwsLambdaHandler {
1414 awsRequest . isBase64Encoded ? Buffer . from ( awsRequest . body , 'base64' ) : awsRequest . body ,
1515 ) ;
1616 const response = new MemoryResponse ( ) ;
17- const context = new Context ( request , response ) ;
17+ const context = new Context ( request , response ) as AwsContext ;
18+ context . aws = { context, event : awsRequest } ;
1819
1920 await app . handle ( context ) ;
2021
@@ -42,4 +43,3 @@ export default function lambdaHandler(app: Application): AwsLambdaHandler {
4243 } ;
4344
4445}
45-
Original file line number Diff line number Diff line change 1+ import { Context } from '@curveball/core' ;
2+
13export type KeyValue = {
24 [ name : string ] : string
35} ;
@@ -6,6 +8,10 @@ export type KeyMultiValue = {
68 [ name : string ] : string [ ]
79} ;
810
11+ export interface AwsContext extends Context {
12+ aws : { context : any , event : AwsRequest }
13+ }
14+
915export type AwsRequest = {
1016 resource : string ,
1117 path : string ,
You can’t perform that action at this time.
0 commit comments