Page Contents
@loopback/example-rpc-server
An example RPC server and application to demonstrate the creation of your own custom server.
Usage
- 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).
Request Format
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.
Contributions
Tests
Run npm test
from the root folder.
Contributors
See all contributors.
License
MIT