aws-lambda-ocaml-runtime icon indicating copy to clipboard operation
aws-lambda-ocaml-runtime copied to clipboard

PoC: Lambda dev server

Open renatoalencar opened this issue 3 years ago • 0 comments

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.t to an Event.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 StringMap uses string as values and not lists. The Uri module uses (string * string list) list as the type for parsed query strings, although AWS Lambda context has key pair values with single values for queryStringParameters and key with an array for multiValueQueryStringParameters. I'm not sure how to handle cases with more than one value for the same key for queryStringParameters. (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, but Arg would also work and wouldn't add a new dependency.

renatoalencar avatar Nov 17 '21 10:11 renatoalencar