mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-07 00:00:15 +02:00
docs(axum): document that path must start with / in Router::route (#3771)
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -176,4 +176,6 @@ let app = Router::new()
|
||||
The static route `/foo` and the dynamic route `/{key}` are not considered to
|
||||
overlap and `/foo` will take precedence.
|
||||
|
||||
Also panics if `path` is empty.
|
||||
Also panics if `path` is empty or does not start with `/` (for example `"Cargo.lock"`).
|
||||
When nesting routers with [`Router::nest`](crate::Router::nest), nested paths are still
|
||||
relative segments and must start with `/` (use `"/Cargo.lock"` rather than `"Cargo.lock"`).
|
||||
|
||||
Reference in New Issue
Block a user