Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/morzhanov/grpc-examples
Goland and Nodejs gRPC examples
https://github.com/morzhanov/grpc-examples
Last synced: 5 days ago
JSON representation
Goland and Nodejs gRPC examples
- Host: GitHub
- URL: https://github.com/morzhanov/grpc-examples
- Owner: morzhanov
- Created: 2020-07-03T11:26:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-27T01:27:22.000Z (almost 3 years ago)
- Last Synced: 2024-11-08T00:53:01.256Z (about 2 months ago)
- Language: Go
- Size: 334 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gRPC Examples
Golang and Nodejs gRPC examples
## Components
- /go-client - contains gRPC golang client
- /go-server - contains gRPC golang server
- /node-client - contains gRPC nodejs client
- /node-server - contains gRPC nodejs serverBoth nodejs and golang client communicate with golang and nodejs servers.
## Run
- Golang server: `go run server.go`
- Golang client: `go run client `
- NodeJS server: `npm run start`
- NodeJS client: `npm run start `## generate golang proto files
1. go to proto folder
2. run:```bash
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
```### NOTE: nodejs proto declarations generated dynamically via `@grpc/proto-loader` package