-
Bug ReportIn previous versions (0.6 series) of axum one could use the very useful tower_http::ServeDir with an axum Router (other types are affected as well), simply by adding it as a service. let app = Router::new()
.route("/", get(handle_default_route))
.fallback_service(
ServeDir::new(static_file_directory)
.fallback(not_found_handler.with_state(shared_state.clone()))
) This no longer works because (I aassume) the responses are now
I have not seen anyone solve this for axum 0.7 and was unable to solve this myself. Maybe there is a simple solution in which case official documentation on how to make this work again would be nice. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Please make sure to also upgrade tower-http to 0.5.0. The old versions of axum and tower-http used the request and response types from v0.2.x of the http create, while the new ones have upgraded to v1.x. |
Beta Was this translation helpful? Give feedback.
Please make sure to also upgrade tower-http to 0.5.0. The old versions of axum and tower-http used the request and response types from v0.2.x of the http create, while the new ones have upgraded to v1.x.