generateLambdaDispatcher now takes a DispatcherStrategy that allows you to specify how you would like to use your lambda (UseWithApiGateway or StandaloneLambda).
There will be compiler errors if you forget to wrap your request and response, so this is perfectly safe.
You can return custom headers and status codes through ApiGatewayResponse, as well as access request metadata through ApiGatewayRequest.
The ApiGatewayResponse wrapper will not be visible when returning responses, errors. The gateway looks like a regular API.
Impure errors (e.g. error) will be propagated upwards by default, meaning you'll get back the stacktrace as a 500 response. This can be disabled by switching the propagateImpureExceptions flag in the DispatcherOptions passed to generateLambdaDispatcher.
ScopedTypeVariables is now a required extension where you use generateLambdaDispatcher.
Nothing significant should've changed if you pass in StandaloneLambda.
I have tried to adhere to the current codebase style, but I may have messed some stuff up. Be liberal with comments.
I guess we'd also need to benchmark this thing. If someone could help with that, that'd be great!
I've also bumped the version to 2.0.5. Not sure if that makes sense as there are breaking changes, but it's up to you to decide.
I guess it would also be good to have some example projects set up to compliment the documentation (which will also need to be updated). I guess I could take up on that.
generateLambdaDispatcher
now takes aDispatcherStrategy
that allows you to specify how you would like to use your lambda (UseWithApiGateway
orStandaloneLambda
).What changes when you pass in
UseWithApiGateway
:There will be compiler errors if you forget to wrap your request and response, so this is perfectly safe.
You can return custom headers and status codes through
ApiGatewayResponse
, as well as access request metadata throughApiGatewayRequest
.The
ApiGatewayResponse
wrapper will not be visible when returning responses, errors. The gateway looks like a regular API.Impure errors (e.g.
error
) will be propagated upwards by default, meaning you'll get back the stacktrace as a 500 response. This can be disabled by switching thepropagateImpureExceptions
flag in theDispatcherOptions
passed togenerateLambdaDispatcher
.ScopedTypeVariables
is now a required extension where you usegenerateLambdaDispatcher
.Nothing significant should've changed if you pass in
StandaloneLambda
.I have tried to adhere to the current codebase style, but I may have messed some stuff up. Be liberal with comments.
I guess we'd also need to benchmark this thing. If someone could help with that, that'd be great!
I've also bumped the version to
2.0.5
. Not sure if that makes sense as there are breaking changes, but it's up to you to decide.I guess it would also be good to have some example projects set up to compliment the documentation (which will also need to be updated). I guess I could take up on that.