Skip to content

Best way to implement an hostname based router? #934

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

You must be logged in to vote

axum doesn't support routing directly based on the hostname. Instead you have to use the Host extractor, check the value in a handler, and forward the request to some other router.

Replies: 2 comments 3 replies

Comment options

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

@davidpdrsn
Comment options

@sylvain101010
Comment options

Answer selected by sylvain101010
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants