Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
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

Implement a HttpService backend that runs on the AWS Lambda Rust Runtime #37

Merged
merged 4 commits into from Jul 9, 2019

Conversation

@kanru
Copy link
Contributor

kanru commented Jul 2, 2019

Description

Add a new server backend that runs on the aws-lambda-rust-runtime. Example usage:

fn main() {
    let mut app = tide::App::new(());
    app.at("/").get(async move |_| "Hello, world!");
    http_service_lambda::run(app.into_http_service());
}

Motivation and Context

Because I wanted to use a framework like tide to handle requests in a Lambda function.
Related issue: #10

How Has This Been Tested?

Build the example code and deployed to a Lambda function. I also ported one app that uses tide to Lambda.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
@secretfader

This comment has been minimized.

Copy link
Contributor

secretfader commented Jul 5, 2019

I made a few comments in-line on this PR, but otherwise it looks solid and gets my approval. 👍

Nicholas Young
@secretfader

This comment has been minimized.

Copy link
Contributor

secretfader commented Jul 9, 2019

I pushed a change that resolves dependencies in this repo via path, and Tide via Git. It seems to have exposed one place where the API wasn't quite up-to-date with master, and I resolved that.

All in all, I think this is a really solid contribution and I'm glad you made it. We can hopefully get this merged shortly.

@secretfader

This comment has been minimized.

Copy link
Contributor

secretfader commented Jul 9, 2019

@rustasync/maintainers LGTM. Could someone else review before merging?

http-service-lambda/src/lib.rs Outdated Show resolved Hide resolved
@Nemo157

This comment has been minimized.

Copy link
Contributor

Nemo157 commented Jul 9, 2019

Awesome to see more http-service implementations, just made a couple small comments, really don't care about the spelling issue, but the distinction between text and binary data makes me wonder if there's an issue in having http-service require all bodies to be Vec<u8> equivalents instead of allowing more structured bodies through.

@Nemo157
Nemo157 approved these changes Jul 9, 2019
@secretfader

This comment has been minimized.

Copy link
Contributor

secretfader commented Jul 9, 2019

It does seem like we should explore the topic of structured bodies. That will probably be useful conversation if we aim to support other protocols, like gRPC, in the future.

Thanks, @Nemo157 for catching that.

@secretfader secretfader merged commit 36dc876 into http-rs:master Jul 9, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.