aws-lambda-ocaml-runtime
aws-lambda-ocaml-runtime copied to clipboard
PoC: Lambda dev server
I'm submitting this an initial proof of concept, so I have something to discuss and raise some questions. The implementation is still very sloppy and it's missing some details, but I would like to ask about some points that are still a little bit obscure for me.
- I need to convert a
Piaf.Request.tto anEvent.t, I've added a mock function to the interface, but I really think that it shouldn't be there and neither be named just mock. But I'm not sure about the best way of dealing with this. - Query strings may have multiple values for the same key, but
StringMapuses string as values and not lists. TheUrimodule uses(string * string list) listas the type for parsed query strings, although AWS Lambda context has key pair values with single values forqueryStringParametersand key with an array formultiValueQueryStringParameters. I'm not sure how to handle cases with more than one value for the same key forqueryStringParameters. (I should probably take a look on how API Gateway works for that). - There are a bunch of hardcoded values, I've really tried generate most of those, but some are just fixed and would be complicated to generate, I think they could be command line arguments with default values.
- I might need to add a command line parser, I've thought of
Cmdliner, butArgwould also work and wouldn't add a new dependency.