Files
tonic/examples/README.md
T
thisKai f6ecaff0de chore(example): Autoreloading server example (#316)
* Create an example of an autoreloading server

* Document the autoreloading server example

* Format autoreloading server example

* Add note about cargo-watch in the examples readme
2020-04-09 17:55:53 -04:00

103 lines
1.4 KiB
Markdown

# Examples
Set of examples that show off the features provided by `tonic`.
## Helloworld
### Client
```bash
$ cargo run --bin helloworld-client
```
### Server
```bash
$ cargo run --bin helloworld-server
```
## RouteGuide
### Client
```bash
$ cargo run --bin routeguide-client
```
### Server
```bash
$ cargo run --bin routeguide-server
```
## Authentication
### Client
```bash
$ cargo run --bin authentication-client
```
### Server
```bash
$ cargo run --bin authentication-server
```
## Load balance
### Client
```bash
$ cargo run --bin load-balance-client
```
### Server
```bash
$ cargo run --bin load-balance-server
```
## TLS (rustls)
### Client
```bash
$ cargo run --bin tls-client
```
### Server
```bash
$ cargo run --bin tls-server
```
## Health Checking
### Server
```bash
$ cargo run --bin health-server
```
## Autoreloading Server
### Server
```bash
systemfd --no-pid -s http::[::1]:50051 -- cargo watch -x 'run --bin autoreload-server'
```
### Notes:
If you are using the `codegen` feature, then the following dependencies are
**required**:
* [bytes](https://crates.io/crates/bytes)
* [prost](https://crates.io/crates/prost)
* [prost-derive](https://crates.io/crates/prost-derive)
The autoload example requires the following crates installed globally:
* [systemfd](https://crates.io/crates/systemfd)
* [cargo-watch](https://crates.io/crates/cargo-watch)