Example: hwsc-grpc-sample-svc
- Read protocol buffer guideline
- Read gRPC with guideline
- Once the endpoint is implemented, add a folder in the hwsc-api-blocks "protobuf" folder
- Make and define proto file in the folder "protobuf/hwsc-file-svc" with a function that uses the service, example
- Ensure protoc 3.9.1 is installed
- Ensure protoc-gen-grpc-web-1.0.6 is installed
- Get the latest
go get -u google.golang.org/grpc
andgo get -u github.com/golang/protobuf/protoc-gen-go
as necessary if you get issue related toproto.ProtoPackageIsVersion
npm install
as needed- Ensure Python 3 gRPC tools are installed
$ python3.7 -m pip install grpcio
or$ pip3.7 install --upgrade grpcio
- To inject an additional tag like
bson
, install and include protoc-go-inject-tag - Modify bash script for generating proto stub
- Run the bash script to generate proto stub
- Publish the npm package needed by
hwsc-frontend
using this guide - Implement your gRPC service in the language you prefer, example
- Implement a wrapper for the gRPC call, example
- Test your function using index.js
After npm install
1. Go to IDE's Preferences
2. Type "eslint" in the search bar
3. Click on ESLint
4. Click on Enable box (You should see ESlint package pointing to node_modules/eslint)
5. Click Apply & OK
hit <b>alt + enter</b> on the ESLint warning, and hit <b>enter</b>
again (or select <i>"Fix current file with ESLint"</i>)
$ ./node_modules/.bin/eslint YOUR_FILE_NAME.js
$ ./node_modules/.bin/eslint --ext .js DIRECTORY_NAME/