mirror of
https://github.com/tokio-rs/axum.git
synced 2025-01-01 08:56:15 +01:00
Fix outdated docs
This commit is contained in:
parent
c570fb2d52
commit
85bb0158be
1 changed files with 3 additions and 5 deletions
|
@ -800,17 +800,15 @@ where
|
||||||
/// Nest a group of routes (or a [`Service`]) at some path.
|
/// Nest a group of routes (or a [`Service`]) at some path.
|
||||||
///
|
///
|
||||||
/// This allows you to break your application into smaller pieces and compose
|
/// This allows you to break your application into smaller pieces and compose
|
||||||
/// them together. This will strip the matching prefix from the URL so the
|
/// them together.
|
||||||
/// nested route will only see the part of URL:
|
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use axum::{routing::nest, prelude::*};
|
/// use axum::{routing::nest, prelude::*};
|
||||||
/// use http::Uri;
|
/// use http::Uri;
|
||||||
///
|
///
|
||||||
/// async fn users_get(uri: Uri) {
|
/// async fn users_get(uri: Uri) {
|
||||||
/// // `users_get` doesn't see the whole URL. `nest` will strip the matching
|
/// // `users_get` will still see the whole URI.
|
||||||
/// // `/api` prefix.
|
/// assert_eq!(uri.path(), "/api/users");
|
||||||
/// assert_eq!(uri.path(), "/users");
|
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// async fn users_post() {}
|
/// async fn users_post() {}
|
||||||
|
|
Loading…
Reference in a new issue