Last active
November 7, 2018 17:47
-
-
Save bernardobelchior/60298c95e7d0953b0f8db185ecb4f5bb to your computer and use it in GitHub Desktop.
Hello world for Rust AWS Lambda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate aws_lambda as lambda; | |
fn main() { | |
lambda::gateway::start(|_req /* API Gateway Request */| { | |
let res = lambda::gateway::response() // Construct API Gateway Response | |
.status(200) | |
.body(lambda::gateway::Body::from("Hello, World!"))?; // Convert String to Body | |
Ok(res) // Return response | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment