-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Provide example on how to use hyper 1.0.0 with tower layers #3154
Comments
Anyone? @seanmonstar |
What have you tried so far? Where do you get stumped? The code you pasted is the hello world example. |
I tried a bunch of things, all too convoluted to meaningfully describe here. This is why I request that a super basic example is provided showing how tower layers can be combined with the lower level hello world example. |
@seanmonstar @o-agassizii if you guys find that is a good solution I can open a PR with this example or if you have suggestions I can implement them (or at least try to). |
Now hyper not relies on tower::service, so it's a bit annoying hard to reuse layer from tower::http. if other web framwork upgrade to latest hyper, would have same issue. right? |
There's an adapter available in https://docs.rs/hyper-util/latest/hyper_util/service/struct.TowerToHyperService.html There's also an item in #3411 to add a middleware section to the guides, if anyone would like to start that. |
Cool, @seanmonstar I've had a play with the TowerToHyperService.html and also raised a PR with examples for middleware docs. |
Version
1.0.0-rc.3
Platform
Not relevant
Description
Can some of the examples for hyper 1.0.0 show how to make use of tower layers with hyper 1.0.0-rc.3?
All of the examples I can find online where people are using older versions of hyper with tower rely on the higher level Server API.
How do you use the lower level hyper 1.0.0 API like in https://hyper.rs/guides/1/server/hello-world/
with tower layers?
The text was updated successfully, but these errors were encountered: