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

Investigate writing bindings to a serverless backend #10

Closed
yoshuawuyts opened this issue Mar 28, 2019 · 4 comments
Closed

Investigate writing bindings to a serverless backend #10

yoshuawuyts opened this issue Mar 28, 2019 · 4 comments

Comments

@yoshuawuyts
Copy link
Member

I'm not sure yet what the right serverless target would be, but I believe one of:

would probably be worth experimenting with to see if we can bind against.

@yoshuawuyts
Copy link
Member Author

yoshuawuyts commented Mar 28, 2019

Now seems like a pretty straight forward candidate:

current

fn handler(request: http::Request<()>) -> http::Result<http::Response<String>> {
    // Tide code goes here.
    todo!();
}

our interpretation

use http_service_now::{Error, Request, Response};

fn handler(request: Request) -> Result<Response, Error> {
    http_service_now::run(MyService)
}

with tide

use http_service_now::{Error, Request, Response};
use tide::Tide;

fn handler(request: Request) -> Result<Response, Error> {
    let app = Tide::new();
    app.at("/foo").get(async || "hello world");
    http_service_now::run(app)
}

We probably need to wrap things in here somehow inside of a futures::block_on call, and I'm not sure yet how to achieve that. But I think it should be feasible!

@yoshuawuyts
Copy link
Member Author

Related issue on the AWS side awslabs/aws-lambda-rust-runtime#96

@secretfader
Copy link
Contributor

Now that we have the initial version of a Lambda backend, do we want to amend or close this issue? cc @yoshuawuyts

@yoshuawuyts
Copy link
Member Author

@secretfader thanks for the ping; I think it's fine to close it! (:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants