caesarjs-plugin-builder
v0.0.2
Published
An utility API library to build plugins for the caesar.js secure microservices framework
Downloads
7
Maintainers
Readme
Caesar.js plugin builder is an utility class library to create plugins and extend caesar.js secure microservices framework for node.js.
Caesar.js Project's homepage
Plugin Builder Api Documentation Page
https://caesarjs.com/documentation/pluginbuilder-api/
A quick code example about building a simple plugin:
const pluginBuilder = require('caesarjs-plugin-builder');
const pb = new pluginBuilder('calculator-division-plugin', 'Calculator plugin', 'Mr Caesar', '0.0.1')
.addRouteWithPatternObject({role: 'calculator', operation: 'division'}, (req, res) => {
let n1 = req.data.n1;
let n2 = req.data.n2;
let division = (n1 / n2);
res.caesarJson({division});
});