Support creating a lambda directly from a ring handler#9
Support creating a lambda directly from a ring handler#9gja wants to merge 2 commits intomhjort:masterfrom
Conversation
|
You have very good point here. This is not a proper middleware because it works only when inserted into certain position in middleware stack. Thank you for the PR. However, when using AWS Lambda you have to minimize dependencies whenever possible to keep the jar file size small. Therefore my original idea with this library was to have zero dependencies. Then the user of this library can choose what json parser he wants to use. For example I now sometimes use That said, would it make sense that macro would take json related functions as parameters instead of depending on |
|
+1 for this PR. It's simpler and including a dependency of a JSON parser is not a big deal nowadays IMO, even in Lambda. |
The main reason for this is that
wrap-apigw-lambda-proxydoes not confirm to the ring spec, especially since status is renamed to status code. It cannot be inserted at any position into the middleware stack. Hence, I wanted to create a single macro which will take a handler and create a lamda function. Since it's a macro, if any dependencies are not included, it will bomb at compile time