API Design · Senior · Question 27 of 75
How can you expose a gRPC service to browsers and REST clients without duplicating logic?
- ✓Correct answer: Use gRPC-Web through a proxy, or a JSON/HTTP transcoding gateway driven by annotations in the
.protofile - 2Rewrite the service in REST
- 3Browsers can call gRPC natively
Explanation
Google's APIs use HTTP annotations in protos to serve the same methods as REST and gRPC.