This directory contains code examples for all the Node.js based gRPC implementations, demonstrating example of -
- simple RPC (like the simple REST)
- streaming from server to client RPC
- streaming from client to server RPC
- bidirectional streaming RPC (both server and client streaming to each other at the same time)
I have made these examples by taking reference from official examples by gRPC
And, for more comprehensive documentation, including an overview and tutorials that use this example code, visit grpc.io.
current example is demonstrating dynamic binary creation using notes.proto file using 'proto3' syntax version
-
install dependencies using
$ npm install
-
to run gRPC server
$ node server.js
-
to run example of simple RPC (like the simple REST)
$ node get_notes.js
-
to run example of streaming from server to client RPC
$ node get_stream.js
-
to run example of streaming from client to server RPC
$ node put_stream.js
-
to run example of bidirectional streaming RPC
$ node gp_stream.js
- Steps to learn gRPC & proto3
- What is gRPC
- Why gRPC deserves all the hype
- gRPC Benchmarks
- What are protocol buffers, and why proto3
- How to use proto3
- proto3 behind the scenes
- Coding style guide and etiquettes for proto3
- Simple python tutorial of proto3
- Back to gRPC Concepts
- This medium blog has a very basic example of using gRPC on node.js
- QuickStart guide for gRPC on node.js
You can find a more detailed tutorial in gRPC Basics: Node.js