The default AWS handler has two arguments: event, and context.
It seems like context is not used in curveball, which is fine. But it would be convenient to have it available on the ctx.request.
Right now if I want to access the AWS context I have to do this before forwarding the event to Curveball.
export function handle(event: any, context: Context): Promise<any> {
context.callbackWaitsForEmptyEventLoop = false;
return handler(app)(event);
}
Additionally there are internal types for AwsRequest and AwsResponse that are not exposed. I had to type them as any in the code above.
Would you accept PR to:
- add AWS context under
ctx.request.awsContext, or other suggestions?
- expose types
AwsRequest and AwsResponse
The default AWS handler has two arguments:
event, andcontext.It seems like context is not used in curveball, which is fine. But it would be convenient to have it available on the
ctx.request.Right now if I want to access the AWS context I have to do this before forwarding the event to Curveball.
Additionally there are internal types for
AwsRequestandAwsResponsethat are not exposed. I had to type them asanyin the code above.Would you accept PR to:
ctx.request.awsContext, or other suggestions?AwsRequestandAwsResponse