-
SummaryVersion% cargo tree | grep axum
├── axum v0.6.20
│ ├── axum-core v0.3.4
├── axum-core v0.3.4 (*)
├── axum-extra v0.7.7
│ ├── axum v0.6.20 (*)
│ ├── axum-core v0.3.4 (*) Cratesaxum = { version = "0.6", default-features = false, features = [ "http1", "json", "query", "headers", "ws", "multipart" ] }
axum-extra = { version = "0.7" }
axum-core = "0.3.4"
tower-http = { version = "0.4.0", features = ["fs", "trace"] } DescriptionTo have axum call a let app = Router::new().nest_service("/", ServeDir::new("/www")).fallback(fallback) I thought of using axum middleware to handle this, but I don't know how to read the body? Is there any other way? axum versionv0.6.20 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can use something like this:
It's one of the examples in The issue is that the router matches the nested service (which itself acts as a |
Beta Was this translation helpful? Give feedback.
You can use something like this:
It's one of the examples in
examples/static-file-server
.The issue is that the router matches the nested service (which itself acts as a
Router
) and it is then responsible for setting fallbacks and such.