Skip to content

How to implement dynamic website directory mounting in Axum? #3367

Answered by mladedav
A-kirami asked this question in Q&A
Discussion options

You must be logged in to vote

You can use SeeveDir for serving files.

As for dynamically changing what is being served, I don't think we have anything to do that easily. If that makes sense to you, you can create a struct that implements Service that you can control from outside and then pass that to axum::serve and mutate it later. You might want to see axum::serve and IntoMakeService, but know that this will be a bit advanced.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by A-kirami
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