The Movie Magic Server exposes MovieService as a gRPC endpoint at localhost:30000. It uses the Buf CLI to generate Go code for this service.
- Make sure you have Go and Buf installed.
- In shell 1, run
go run ./server/main.go
to start the server. - In shell 2, run
go run ./client/main.go
to start the client.
The client should now print a list of movies.
Note: Server runs on port 30000.
buf curl --schema . --protocol grpc --http2-prior-knowledge http://localhost:30000/movie.v1.MovieService/ListMovies
This prints a list of movies in JSON format.
- Install the Envoy proxy. We will use it to make the Movie Magic gRPC service available as a gRPC-web service.
- Start Envoy:
envoy -c envoy.yaml
. Theenvoy.yaml
file configures Envoy to make the gRPC-web service available at http://localhost:8080/api - Run
buf curl
to verify the service:
buf curl --schema . --protocol grpcweb --http2-prior-knowledge http://localhost:8080/api/movie.v1.MovieService/ListMovies
This prints a list of movies in JSON format.
**Note: Currently this does not work **
It returns this error:
{
"code": "unimplemented",
"message": "unknown service /movie.v1.MovieService"
}
make proto-lint
make proto-gen