Golang and Nodejs gRPC examples
- /go-client - contains gRPC golang client
- /go-server - contains gRPC golang server
- /node-client - contains gRPC nodejs client
- /node-server - contains gRPC nodejs server
Both nodejs and golang client communicate with golang and nodejs servers.
- Golang server:
go run server.go
- Golang client:
go run client <max-rand-number> <port>
- NodeJS server:
npm run start
- NodeJS client:
npm run start <max-rand-number> <port>
- go to proto folder
- run:
protoc \
--go_out=Mgrpc/service_config/service_config.proto=/internal/proto/grpc_service_config:. \
--go-grpc_out=Mgrpc/service_config/service_config.proto=/internal/proto/grpc_service_config:. \
--go_opt=paths=source_relative \
--go-grpc_opt=paths=source_relative \
random.proto