-
I basically copied the example code from Sorry if this is a stupid question, I'm very new to lambda. use lambda_http::{
Error, IntoResponse, Request,
run, service_fn, tracing,
http::{Response, StatusCode},
};
async fn function_handler(_event: Request) -> Result<impl IntoResponse, Error> {
let resp = Response::builder()
.status(StatusCode::OK)
.header("Content-Type", "application/json")
.body("{\"msg\": \"you're welcome (5)\"}".to_string())
.map_err(Box::new)?;
Ok(resp)
}
#[tokio::main]
async fn main() -> Result<(), Error> {
// required to enable CloudWatch error logging by the runtime
tracing::init_default_subscriber();
run(service_fn(function_handler)).await
} the response:
|
Beta Was this translation helpful? Give feedback.
Answered by
Jimmy-Z
Jun 25, 2025
Replies: 1 comment
-
Turns out it's because of streaming, if I set it back to buffered, it's not wrapped anymore. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Jimmy-Z
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Turns out it's because of streaming, if I set it back to buffered, it's not wrapped anymore.