On our previous gRPC article we had looked on how to create gRPC server/clients and call gRPC endpoints using api gateway built on node.js framework i.e express.js
Often time, this solution might not be needed where we are maily focusing on writing business logic for the backend side using gRPC function. What we might want is to quickly test and deliver those gRPC endpoints so later on whoever wishes to consume or use our function can call with any methods they choose.
When we first come from REST background, we instantly look for something like PostMan, Insomnia or other gRPC client GUI based tool from where we directly call our just written awesome gRPC endpoints.
Worry not, in this article we are going to learn one of that type of GUI based tool, to know how to call and test gRPC endpoints just the way we love to do for our REST api endpoints.
Option 1: BloomRPC
BloomRPC aims to provide the simplest and most efficient developer experience for exploring and querying your GRPC services.
How to call and test gRPC api using BloomPRC
Step 1 : Install BloomRpc
BloomRpc is supported on all operating system (windows, linux and mac).
macOS/Homebrew
brew install --cask bloomrpc
Windows/Chocolatey
choco install bloomrpc
To build from source
git clone https://github.com/uw-labs/bloomrpc.git
cd bloomrpc
yarn install && ./node_modules/.bin/electron-rebuild
npm run package
Step 2 : Prepare gRPC Server
Follow this article: gRPC server with node.js
Step 3: Launch BloomRpc, Import proto and Test
Option 2: Postman gRPC
Postman supports some pretty advanced workflows, but you can still get started in just a few steps:
How to call and test gRPC endpoints using Postman
Step 1: Install Postman
To install postman, please follow official documentation from here.
Step 2: Invoke
- In the left-hand sidebar, click New.
- Select gRPC Request.
- Type the address of your gRPC server into the URL bar.
- Click on the Protobuf definition selector to upload your proto file.
- Select your desired service and method.
- Click Invoke.