Is it posible to add/update/remove router when program is running? #1395
-
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Sep 19, 2022
Replies: 1 comment 3 replies
-
Yes that is possible. I'm curious why you need that though. Like if you were able to write |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
naughtz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes that is possible. I'm curious why you need that though. Like if you were able to write
axum::router::get_app_router().nest("/newrouter", get(service));
, where doesservice
come from? You gotta have it defined when you compile your code. So is it a matter of enabling/disabling endpoints? That feels like simpler and can be done by having some shared state that you update and either check in middleware or in handlers.