Installation
$ npm install @betit/orion-node-sdk
Basic example
Note - You will need to have running all of the orion dependencies
Add the following into foo.js
and then run node foo.js --verbose
const ORION = require('@betit/orion-node-sdk');
const FOO = new ORION.Service('foo');
FOO.handle('get', (req, reply) => {
reply(new ORION.Response('foo'));
});
FOO.listen(() => FOO.logger.createMessage('ready').send());
Then add the following into bar.js
and then run node bar.js
const ORION = require('@betit/orion-node-sdk');
const BAR = new ORION.Service('bar');
const REQ = new ORION.Request('/foo/get');
BAR.call(REQ, res => {
});
You can find more detailed examples in the examples
folder.
Documentation
Auto-generated documentation is located here.
Tests
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ npm test
License
MIT