Closed softdevca closed 1 year ago
Same here.
I believe https://github.com/hyperium/tonic/blob/master/examples/src/grpc-web/server.rs#L42 should work for you?
I believe https://github.com/hyperium/tonic/blob/master/examples/src/grpc-web/server.rs#L42 should work for you?
Thanks @LucioFranco, works like a charm! I assume documentation needs to be fixed...
It worked for me as well, though I had to add the Cors layer manual now that I cannot use tonic_web::enable()
.
Ah yup those docs need to be updated!
@softdevca yeah the cors stuff got removed iirc, you can check the PRs we made for tonic-web to see the background.
Gonna close this since I think we got this all resolved.
Bug Report
It was proposed to remove the
NamedService
bound oftonic_web::enable()
in issue #1115. This change was accepted but it breaks adding theenable
'd service to a Tonic server.Issue #1174 was briefly filed and closed with a work around.
Version
Platform
MacOS 13.0.1 on M1 Pro, rust 1.65.0 Pop OS Linux on AMD, rust 1.65.0
Description
The standard example below will not compile because
add_service
requires theNamedService
trait andtonic_web::enable
no longer provides it.