Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to use a Service factory for Server::serve() #52

Closed
daxpedda opened this issue Jul 29, 2022 · 2 comments
Closed

Document how to use a Service factory for Server::serve() #52

daxpedda opened this issue Jul 29, 2022 · 2 comments

Comments

@daxpedda
Copy link
Contributor

I would like to wrap a user supplied app, like a Router, for that purpose I would like to use 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.

The solution I found is wrapping it in Shared. I believe some documentation in axum-server would help.

See tokio-rs/axum#1203 for the original problem.

@programatik29
Copy link
Owner

I will add it for next release.

@daxpedda
Copy link
Contributor Author

daxpedda commented Aug 3, 2022

Added in 1a68546.

@daxpedda daxpedda closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants