docs: Clarify route_layer does not apply middleware to the fallback handler (#3567)

This commit is contained in:
Mohamed Macow
2025-11-21 23:17:24 +01:00
committed by GitHub
parent 26367b9f1e
commit 7fd17ceba5
+1 -2
View File
@@ -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.