Skip to content

Instantly share code, notes, and snippets.

@bernardobelchior
Last active November 7, 2018 17:47
Show Gist options
  • Save bernardobelchior/60298c95e7d0953b0f8db185ecb4f5bb to your computer and use it in GitHub Desktop.
Save bernardobelchior/60298c95e7d0953b0f8db185ecb4f5bb to your computer and use it in GitHub Desktop.
Hello world for Rust AWS Lambda
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