Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 server

Both 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