Skip to content

Instantly share code, notes, and snippets.

@bernardobelchior
Created November 7, 2018 23:08
Show Gist options
  • Save bernardobelchior/ea69dd836553a5c5b50eb093158837d0 to your computer and use it in GitHub Desktop.
Save bernardobelchior/ea69dd836553a5c5b50eb093158837d0 to your computer and use it in GitHub Desktop.
fn main() {
lambda::gateway::start(|req| {
//...
let encoded_thumbnail = encode_png_image(thumbnail)?;
let encoded_thumbnail = base64::encode(&encoded_thumbnail);
let res = lambda::gateway::response() // Create a response
.status(200) // Set HTTP status code as 200 (Ok)
.body(lambda::gateway::Body::from(encoded_thumbnail))?; // Convert the encoded_thumbnail to
Ok(res)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment