Skip to content

Example project used to illustrate GRPC server-client connection locally

License

Notifications You must be signed in to change notification settings

mimimalizam/hello-world

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helloworld in grpc-elixir

This example is originally found in this repo. Since this example is being run in the BoxBox environment, client (prvi/client.exs) is connecting to boxbox:50051. In general, it can be replaced, e.g with localhost:50051.

Usage

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

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:
$ protoc -I priv/protos --elixir_out=plugins=grpc:./lib/ priv/protos/helloworld.proto

Refer to protobuf-elixir for more information.

How to start server when starting your application?

Change the config to:

config :grpc, start_server: true

About

Example project used to illustrate GRPC server-client connection locally

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%