Running middleware on matched routes only? #1593
-
Hi there! Is it possible to run middleware only on routes that match in the router? For example, we have a custom metrics middleware layer, but it creates a lot of noise in the metrics when the path is recorded as a label for public services that get a large amount of spam requests (script kiddies looking for exposed secret files, etc) Of course, we can make a Hopefully that makes sense! Thanks for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You mean like https://docs.rs/axum/latest/axum/struct.Router.html#method.route_layer? |
Beta Was this translation helpful? Give feedback.
You mean like https://docs.rs/axum/latest/axum/struct.Router.html#method.route_layer?