Skip to content
This repository was archived by the owner on Jun 21, 2020. It is now read-only.

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 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
Copy link
Contributor

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

@secretfader
Copy link
Contributor

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
Copy link
Contributor

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

@Nemo157
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.

@secretfader
Copy link
Contributor

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants