Do we need MethodRouter::route_layer? #2136
-
I am learning middleware of axum, as MethodRouter::layer is always bind to a specific method_router. And the document says: This works similarly to MethodRouter::layer except the middleware will only run if the request matches a route. So I wonder in what case rather using MethodRouter::route_layer than MethodRouter::layer? |
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Aug 1, 2023
Replies: 1 comment 3 replies
-
We do. Middleware’s added with Same applies for |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
zishon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We do. Middleware’s added with
layer
also run for the fallback. If you don’t want that you can useroute_layer
.Same applies for
Router