I write this example to get a starter project based on gRPC microservices with NestJS.
Folders:
micro-svc
is the gRPC serviceclient-svc
is the client which communicate with the gRPC sercice and it exposes a basic REST API
If not installed, install protobuf
# MacOS
brew install protobuf
Now it will be possible to generate services from proto file. For example:
protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=outputEncodeMethods=false,outputJsonMethods=false,outputClientImpl=false,nestJs=true --ts_proto_out=. ./src/proto/hello.proto