lambda_router/
not_found.rs

1//! # not_found
2//! a simple 404 response with no body for convenience
3
4use lambda_http::{Body, Error, Request, Response};
5
6/// a simple 404 response when no routes are matched. provided as a convenience
7/// you can see how to implement your own in the docs
8pub async fn not_found(_: Request) -> Result<Response<Body>, Error> {
9    let resp = lambda_http::Response::builder()
10        .status(404)
11        .body(().into())
12        .map_err(Box::new)?;
13
14    Ok(resp)
15}