Root wildcards and nesting #1561
-
Hello. How to serve statics files as the root url, and the API from /api prefix ? In this form, it gives an error in runtime about overlapping routes:
|
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Nov 22, 2022
Replies: 1 comment 1 reply
-
You need to use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to use
Router::fallback
for serving the static files. See https://github.com/tokio-rs/axum/blob/main/examples/static-file-server/src/main.rs#L80-L89