How to Generate the Server and Client Libraries in NodeJS

8 views
Skip to first unread message

Dan Wilson

unread,
May 5, 2021, 5:28:14 AMMay 5
to grpc.io
I am quite new to gRPC but I wish to use it in my current application.

I am building the Backend Server in NodeJS

I have created my Service Definition file as below:

```syntax = "proto3";

package location;

import "protos/auth.proto";

service LocationManager{
    rpc updateLocation(LocationUpdateRequest) returns (LocationUpdateResponse);
}

enum LocationUpdateTarget{
    CUSTOMER = 0;
    RIDER = 1;
}

message Location{
     double longitude = 3;
     double latitude = 4;
}

message LocationUpdateRequest{
    auth.AuthParams authParams = 1;
    LocationUpdateTarget locationUpdateTarget = 2;
    Location location = 3;
}

message LocationUpdateResponse{
    int32 statusCode = 1;
}
```
How do I generate the NodeJS Client Libraries for My Server and The Client.

The Documentations isn't clear about this.

Thank you.


Reply all
Reply to author
Forward
0 new messages