Skip to content

Latest commit

 

History

History
76 lines (59 loc) · 1.88 KB

README.md

File metadata and controls

76 lines (59 loc) · 1.88 KB

Helloworld in grpc-elixir

Usage

  1. Install deps and compile
$ mix do deps.get, compile
  1. Run the server
$ mix run --no-halt
  1. Run the client script
$ mix run priv/client.exs

HTTP Transcoding

# Say hello
curl -H 'Content-type: application/json' http://localhost:50051/v1/greeter/test

# Say hello from
curl -XPOST -H 'Content-type: application/json' -d '{"name": "test", "from": "anon"}' http://localhost:50051/v1/greeter

Regenerate Elixir code from proto

  1. Modify the proto priv/protos/helloworld.proto
  2. Install protoc here
  3. Install protoc-gen-elixir
mix escript.install hex protobuf
  1. Generate the code:
$ (cd ../../; mix build_protobuf_escript && mix escript.build)
$ protoc -I priv/protos --elixir_out=:./lib/ --grpc_elixir_out=./lib --plugin=