mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-24 00:00:16 +02:00
Remove B type param (#1751)
Co-authored-by: Jonas Platte <[email protected]> Co-authored-by: Michael Scofield <[email protected]>
This commit is contained in:
co-authored by
Jonas Platte
Michael Scofield
parent
9be0ea934c
commit
4e4c29175f
@@ -71,7 +71,10 @@ fn using_serve_dir_with_handler_as_service() -> Router {
|
||||
(StatusCode::NOT_FOUND, "Not found")
|
||||
}
|
||||
|
||||
let serve_dir = ServeDir::new("assets").not_found_service(handle_404.into_service());
|
||||
// you can convert handler function to service
|
||||
let service = handle_404.into_service();
|
||||
|
||||
let serve_dir = ServeDir::new("assets").not_found_service(service);
|
||||
|
||||
Router::new()
|
||||
.route("/foo", get(|| async { "Hi from /foo" }))
|
||||
|
||||
Reference in New Issue
Block a user