/grpc-testing

gRCP Testing

Primary LanguageGo

gRPC Testing

To start the gRPC server, run the following command from the root of the repository:

go run cmd/server/server.go 

To execute the gRPC client, run the following command from the root of the repository:

go run cmd/client/client.go

Alternative Ways to Test gRPC Server

Running the client is not necessary to test the gRPC service. The gRPC server implements server reflection (you can read more about it here) so you may use tools like grpcurl to test the service.

Example:

grpcurl -plaintext -d '{"name":"Omar"}' localhost:8080 hello.Greeter/SayHello

The previous command should give you the following output from the gRPC server:

{
  "message": "Hello there Omar"
}