mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-24 00:00:16 +02:00
Allow Routers to inherit state (#1368)
* Rename Fallback::Custom to Fallback::Service
* Allow Routers to inherit state
* Rename Router::{nest => nest_service} and add new nest method for Routers
* Fix lints
* Add basic tests for state inheritance
* Changelog
This commit is contained in:
@@ -58,7 +58,7 @@ async fn main() {
|
||||
)
|
||||
.route("/keys", get(list_keys))
|
||||
// Nest our admin routes under `/admin`
|
||||
.nest("/admin", admin_routes(shared_state).into_service())
|
||||
.nest("/admin", admin_routes(shared_state))
|
||||
// Add middleware to all routes
|
||||
.layer(
|
||||
ServiceBuilder::new()
|
||||
|
||||
Reference in New Issue
Block a user