As exposing your Lambda through API Gateway is a very common approach, do you think it would make sense to add "native" support for it inside the runtime?
I'm thinking something like this:
generateLambdaDispatcher UseWithAPIGateway.
Passing UseWithAPIGateway will automatically adjust the plumbing underneath so it knows how to parse the incoming event and send back a well-formed response.
Then the handlers could look something like
-- This type will be provided by the runtime
data APIGatewayEvent e =
APIGatewayEvent
{ resource :: String
.....
, body :: e }
handler :: APIGatewayEvent SomeValue -> Context -> IO (Either Error Response)
handler ...
As exposing your Lambda through API Gateway is a very common approach, do you think it would make sense to add "native" support for it inside the runtime?
I'm thinking something like this:
generateLambdaDispatcher UseWithAPIGateway
.Passing
UseWithAPIGateway
will automatically adjust the plumbing underneath so it knows how to parse the incoming event and send back a well-formed response.Then the handlers could look something like
I could submit a PR if you're interested.