Blame view
node_modules/jayson/examples/method_routing/client.js
278 Bytes
f7563de62
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
var jayson = require(__dirname + '/../..'); // create a client var client = jayson.client.http({ port: 3000, hostname: 'localhost' }); // invoke "add_2" client.request('add_2', [3], function(err, error, response) { if(err) throw err; console.log(response); // 5! }); |