More docs and expand key_value_store example

This commit is contained in:
David Pedersen
2021-06-08 12:43:16 +02:00
parent d7605d3184
commit 1f8b39f05d
13 changed files with 920 additions and 431 deletions
+7 -5
View File
@@ -305,16 +305,18 @@ async fn boxing() {
#[tokio::test]
async fn service_handlers() {
use crate::ServiceExt as _;
use std::convert::Infallible;
use crate::service::ServiceExt as _;
use tower::service_fn;
use tower_http::services::ServeFile;
let app = route(
"/echo",
service::post(service_fn(|req: Request<Body>| async move {
Ok::<_, Infallible>(Response::new(req.into_body()))
})),
service::post(
service_fn(|req: Request<Body>| async move {
Ok::<_, BoxError>(Response::new(req.into_body()))
})
.handle_error(|_error: BoxError| StatusCode::INTERNAL_SERVER_ERROR),
),
)
.route(
"/static/Cargo.toml",