Skip to content

now-lambda: Better interface (use http/af request and response) #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 15, 2019

Conversation

anmonteiro
Copy link
Owner

@anmonteiro anmonteiro commented Apr 15, 2019

This makes the now-lambda handler interface be the following:

type body = string

val handler
  :  Httpaf.Request.t * body option
  -> Lambda_runtime.Context.t
  -> (Httpaf.Response.t * body, string) result

Since in now.sh we're effectively handling HTTP requests, it makes sense to make the interface accept and return requests and responses, respectively.

TODOs for this PR:

  • convert the examples to the new interface
  • maybe get rid of the Types module in favor of something else.

@anmonteiro anmonteiro force-pushed the now-lambda-httpaf-request-response branch from dcfa2f2 to d75c12b Compare April 15, 2019 14:57
@anmonteiro anmonteiro merged commit 9c7a2b4 into master Apr 15, 2019
@anmonteiro anmonteiro deleted the now-lambda-httpaf-request-response branch April 15, 2019 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant