Page Contents

@loopback/example-rpc-server

An example RPC server and application to demonstrate the creation of your own custom server.

![powered-by-loopback]

Usage

  1. Install the new loopback CLI toolkit.
npm i -g @loopback/cli
  1. Download the “rpc-server” application.
lb4 example rpc-server
  1. Switch to the directory.
cd loopback-example-rpc-server
  1. 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