FPC NODE SDK
Run Unit Test
npm install && npm test
Server API
var FPC = require('finerprint-container-node-sdk');
var server = new FPC.Server('127.0.0.1','9090');
server.addHandler('ServiceName',function(res){
res.send({
words: "hello world!"
});
});
server.on('connect',function(){
server.register();
});
server.on('register',function(){
console.log('register success');
});
Client API
var FPC = require('finerprint-container-node-sdk');
var client = new FPC.Client('127.0.0.1','9090');
client.on('connect',function(){
client.register();
});
client.on('register',function(){
client.eventRequest('ServiceName', {
name: 'event'
});
client.rpcRequest('ServiceName',{
name: 'rpc'
},function(body){
console.log(body);
}, 2000);
});