mirror of
https://github.com/tokio-rs/axum.git
synced 2024-10-23 17:36:39 +02:00
Apply suggestions from code review
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
This commit is contained in:
parent
657a0893b5
commit
bbf1852c56
1 changed files with 3 additions and 3 deletions
|
@ -106,15 +106,15 @@ async fn fallback() {}
|
|||
let app = Router::new()
|
||||
.nest("/api", nested_router)
|
||||
.nest_service("/assets", nested_service)
|
||||
// the fallback is not called for request starting with `/bar` but will be
|
||||
// called for requests starting with `/foo` if `nested_router` doesn't have
|
||||
// the fallback is not called for request starting with `/assets` but will be
|
||||
// called for requests starting with `/api` if `nested_router` doesn't have
|
||||
// a matching route
|
||||
.fallback(fallback.into_service());
|
||||
# let _: Router = app;
|
||||
```
|
||||
|
||||
Note that you would normally use [`tower_http::services::ServeDir`] for serving
|
||||
static files and thus not calling `nest_service` with a `Router`.
|
||||
static files and thus not call `nest_service` with a `Router`.
|
||||
|
||||
# Panics
|
||||
|
||||
|
|
Loading…
Reference in a new issue