Closed daxpedda closed 1 year ago
I would like to wrap a user supplied app, like a Router, for that purpose I would like to use ServiceBuilder.
Router
ServiceBuilder
The issue is that Server::serve() needs a service factory, like what can be produced with Router::into_make_service(), which isn't available for ServiceBuilder.
Server::serve()
Router::into_make_service()
The solution I found is wrapping it in Shared. I believe some documentation in axum-server would help.
Shared
axum-server
See https://github.com/tokio-rs/axum/issues/1203 for the original problem.
I will add it for next release.
Added in https://github.com/programatik29/axum-server/commit/1a68546ed34ebd8f003c837855ca0101be32205.
I would like to wrap a user supplied app, like a
Router
, for that purpose I would like to useServiceBuilder
.The issue is that
Server::serve()
needs a service factory, like what can be produced withRouter::into_make_service()
, which isn't available forServiceBuilder
.The solution I found is wrapping it in
Shared
. I believe some documentation inaxum-server
would help.See https://github.com/tokio-rs/axum/issues/1203 for the original problem.