Bug Report
In 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 Response<Body> instead of being able to be a Response<UnsyncBoxBody<Bytes, BoxError> which is still used by the tower_http.
breaking: The following types/traits are no longer generic over the request body
(i.e. the B type param has been removed) (#1751 and #1789):
[…]
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.
Bug Report
In 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.
This no longer works because (I aassume) the responses are now
Response<Body>instead of being able to be aResponse<UnsyncBoxBody<Bytes, BoxError>which is still used by thetower_http.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.