An example RPC server and application to demonstrate the creation of your own custom server.
- Install the new loopback CLI toolkit.
npm i -g @loopback/cli
- Download the "rpc-server" application.
lb4 example rpc-server
- Switch to the directory.
cd loopback-example-rpc-server
- Start the app!
npm start
Next, use your favorite REST client to send RPC payloads to the server (hosted on port 3000).
The request body should contain a controller name, method name and input object. Example:
{
"controller": "GreetController",
"method": "basicHello",
"input": {
"name": "Janet"
}
}
The router will determine which controller and method will service your request based on the given names in the payload.
Run npm test
from the root folder.
See all contributors.
MIT