Skip to content

Commit

Permalink
chore: Add grpcurl example in helloworld readme (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
liufuyang authored and LucioFranco committed Jan 14, 2020
1 parent f4ecf47 commit bd0f5ed
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion examples/helloworld-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,23 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
```

You should now be able to run your HelloWorld gRPC server using the command `cargo run --bin helloworld-server`. This uses the [[bin]] we defined earlier in our `Cargo.toml` to run specifically the server. If have a gRPC GUI client such as [Bloom RPC] you should be able to send requests to the server and get back greetings!
You should now be able to run your HelloWorld gRPC server using the command `cargo run --bin helloworld-server`. This uses the [[bin]] we defined earlier in our `Cargo.toml` to run specifically the server.

If have a gRPC GUI client such as [Bloom RPC] you should be able to send requests to the server and get back greetings!

Or if you use [grpcurl] then you can simply try send requests like this:
```
$ grpcurl -plaintext -import-path ./proto -proto helloworld.proto -d '{"name": "Tonic"}' localhost:50051 helloworld.Greeter/SayHello
```
And receiving responses like this:
```
{
"message": "Hello Tonic!"
}
```

[bloom rpc]: https://github.com/uw-labs/bloomrpc
[grpcurl]: https://github.com/fullstorydev/grpcurl

## Writing our Client

Expand Down

0 comments on commit bd0f5ed

Please sign in to comment.