Created
November 7, 2018 23:08
-
-
Save bernardobelchior/ea69dd836553a5c5b50eb093158837d0 to your computer and use it in GitHub Desktop.
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
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