Skip to content

Is it posible to add/update/remove router when program is running? #1395

Answered by davidpdrsn
naughtz asked this question in Q&A
Discussion options

You must be logged in to vote

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 does service 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.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@naughtz
Comment options

@davidpdrsn
Comment options

@naughtz
Comment options

Answer selected by naughtz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1392 on September 19, 2022 18:57.