IMPORTANT: You need to do the steps in sequence in order for the state of the lesson's learning environment to be consistent. Otherwise, you'll get behaviors that might be confusing.
The objective of this scenario is to demonstrate how to use the Node.js package
grpc-tools to auto-generate gRPC messages and procedures defined in the
.proto file that ships with ProgrammableWeb's demonstration gRPC API SimpleService.
Also, you'l be able to view the auto-generated code in the version of Visual Studio Code that's built directly into the Katacoda interactive learning environment.
Here's a listing of the lessons in the scenario.
Lesson 1 - Get the example code
Lesson 2 - Install
Lesson 3 - Generate the gRPC messages and services
Lesson 4 - Work with the genereated code
To proceed, click the
Start Scenario button.
You've crossed the finish line!
In this scenario you learned how to:
- Get the example code
- Generate the gRPC messages and services
- Work with the genereated code
Please be advised that although autogenerating Node.js code using
The gRPC community provides an example for integrating auto-generated code into a Node.js gRPC server and gRPC client. You can find the example here.
Auto-generating gRPC Code for Node.js
Get the example code
The objective of this lesson is to demonstrate how to clone the source code for the example gRPC API from GitHub.
We'll use the
.proto file in the API source code a when auto-generating message object on a language specific basis.
Once the code is cloned from GitHub we're going to create a directory in the source code directory. One directory will be named
node_autogen. The directory,
Step 1: Clone the source code for the demonstration gRPC API
SimpleService from GitHub
git clone https://github.com/programmableweb/simple-node-grpc
Step 2: Navigate to gRPC API working directory
In the next step we'll install the Node.js package,
grpc-tools. We'll use