Reputation:
Does anyone know how can I send a request to my gRPC service using rails application? Like I have my rails web application & I want to send a request to my HELLO gRPC Service when I click a button in the web-app?
Suppose this is my gRPC request
call AddCallback (Service Endpoint)
payment_handle (TYPE_STRING) => test
name (TYPE_STRING) => test
url (TYPE_STRING) => test
Upvotes: 1
Views: 859
Reputation: 874
For Ruby gRPC and Rails apps I have found this repo: https://github.com/Gusto/grpc-web-ruby, seems to be doing exactly what you need.
Or I suppose you could set up Envoy to proxy HTTP to gRPC, good explanation is e.g. here: https://blog.envoyproxy.io/envoy-and-grpc-web-a-fresh-new-alternative-to-rest-6504ce7eb880
If you like example more, this one is a good start: https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/helloworld
Upvotes: 2