get current router in middleware #1058
Answered
by
davidpdrsn
tingfeng-key
asked this question in
Q&A
-
How to get the current access route in middleware or handler? I want to use this to realize the restrictions of different user identities on access routes |
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
May 27, 2022
Replies: 1 comment 3 replies
-
You can extract either async fn handle(uri: axum::http::Uri) {} Or async fn handle(uri: axum::extract::MatchedPath) {} |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
tingfeng-key
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can extract either
Uri
:Or
MatchedPath
: