mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-19 00:00:14 +02:00
Fix outdated docs
This commit is contained in:
+3
-5
@@ -800,17 +800,15 @@ where
|
||||
/// Nest a group of routes (or a [`Service`]) at some path.
|
||||
///
|
||||
/// 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
|
||||
/// nested route will only see the part of URL:
|
||||
/// them together.
|
||||
///
|
||||
/// ```
|
||||
/// use axum::{routing::nest, prelude::*};
|
||||
/// use http::Uri;
|
||||
///
|
||||
/// async fn users_get(uri: Uri) {
|
||||
/// // `users_get` doesn't see the whole URL. `nest` will strip the matching
|
||||
/// // `/api` prefix.
|
||||
/// assert_eq!(uri.path(), "/users");
|
||||
/// // `users_get` will still see the whole URI.
|
||||
/// assert_eq!(uri.path(), "/api/users");
|
||||
/// }
|
||||
///
|
||||
/// async fn users_post() {}
|
||||
|
||||
Reference in New Issue
Block a user