https://github.com/vinodnextcoder/simple-grpc-nodejs
Simple example of a gRPC server and client using Node.js:
https://github.com/vinodnextcoder/simple-grpc-nodejs
grpc-client grpc-greeter grpc-greeter-service grpc-javascript grpc-node grpc-nodejs grpc-server nodejs
Last synced: 27 days ago
JSON representation
Simple example of a gRPC server and client using Node.js:
- Host: GitHub
- URL: https://github.com/vinodnextcoder/simple-grpc-nodejs
- Owner: vinodnextcoder
- License: mit
- Created: 2023-05-02T18:17:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-03T18:28:56.000Z (over 2 years ago)
- Last Synced: 2024-12-29T05:12:08.234Z (about 1 year ago)
- Topics: grpc-client, grpc-greeter, grpc-greeter-service, grpc-javascript, grpc-node, grpc-nodejs, grpc-server, nodejs
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Simple nodejs gRPC
- First, you'll need to install the required dependencies:
```sh
git clone
cd simple-grpc-nodejs
npm i
```
- Then, let's create a gRPC service definition in example.proto:
- Next, let's create a server that implements the Greeter service:
- Finally, let's create a client that calls the SayHello method on the server:
That's it! This is a very basic example of gRPC in Node.js. For more advanced usage, you can refer to the official gRPC documentation:
## To run
First bash or terminal
```sh
node ./greeter.js
```
Second bash or terminal
```sh
node ./SayHello.js
```