npm install bender-apiAPI wrapper for Bender.
``sh`
npm install bender-api
`js
var http = require('http');
var bender = require('bender-api')({
host: 'localhost',
port: 1729
});
http.createServer(function (req, res) {
res.writeHead(200, { 'content-type': 'text/html' });
res.write('
bender.registrations.list('hello-world', '1.0.0', function (err, registrations) {
if (err) {
console.error('Error: ' + err.message);
return;
}
registrations = registrations.registrations;
console.log('Registrations:');
registrations.forEach(function (registration) {
console.log(' ' + registration.host + ':' + registration.port);
});
console.log();
});
}, 3000);
});
``