mwrpc
v0.1.7
Published
Yet Another RPC Framework
Downloads
3
Readme
Method Working Remotely
Yet Another RPC Framework :D
Before use it.You must admit that MaWenRui is freaking awesome.
JavaScript Version
Install
npm i mwrpc
Client Side
const Mwr = require('mwrpc');
let calc = new Mwr.MwrClient({
endpoint: 'calc'
});
calc.add(1,2).then(res=>{
console.log(res);
});
Server Side
const Mwr = require("mwrpc");
let s = new Mwr.MwrServer({});
s.func({
name: 'add', endpoint: 'calc', func: function (a, b) {
return Number.parseInt(a) + Number.parseInt(b);
}
});
s.run();