mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-29 00:00:18 +02:00
docs: Clarify route_layer does not apply middleware to the fallback handler (#3567)
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
Apply a [`tower::Layer`] to the router that will only run if the request matches
|
Apply a [`tower::Layer`] to the router that will only run if the request matches
|
||||||
a route.
|
a route.
|
||||||
|
|
||||||
Note that the middleware is only applied to existing routes. So you have to
|
Note that the middleware is only applied to existing routes. First add your routes and then call `route_layer`
|
||||||
first add your routes (and / or fallback) and then call `route_layer`
|
|
||||||
afterwards. Additional routes added after `route_layer` is called will not have
|
afterwards. Additional routes added after `route_layer` is called will not have
|
||||||
the middleware added.
|
the middleware added.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user