Example of ExpressJS app & Thrift to simulate RPC (Remote Procedure Call) within microservices. See the differences between REST (ExpressJS in this case) and Thrift architecture.
Using Homebrew, use this command in Terminal
brew install thrift
Note: Refer to this docs for other platform.
We need Express and Thrift for NodeJS as dependencies, type this in Terminal.
cd /path/to/repo
npm install
Note: Make sure you have installed NodeJS
node server.js
node client.js
Type this in Terminal
curl -i http://localhost:3000/hello?name=AnyName
Open a browser and type http://localhost:3000/hello?name=AnyName
in location bar.
See the code for more explanation and see how Thrift works compare to REST.
*More documentation about Thrift is here