Skip to content

Overlapping routes with nest("/", _) #453

Answered by davidpdrsn
wooden-worm asked this question in Q&A
Discussion options

You must be logged in to vote

This exact use case was mentioned in the changelog actually:

  • added: Router::fallback for adding handlers for request that didn't match any routes. Router::fallback must be use instead of nest("/", _) ([#408])

So this should work .fallback(static_file_svc).nest("/app", app::routes()). The order doesn't matter. You might also wanna update to static_file_svc to return some meaningful response for non-GET requests, probably 404.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wooden-worm
Comment options

Answer selected by davidpdrsn
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