Skip to content

Instantly share code, notes, and snippets.

@adrai
Created September 17, 2014 14:08
Show Gist options
  • Save adrai/9b95c881fcd3dd489264 to your computer and use it in GitHub Desktop.
Save adrai/9b95c881fcd3dd489264 to your computer and use it in GitHub Desktop.
oboe + restify
var restify = require('restify'),
oboe = require('oboe');
var client = restify.createClient({
url: 'http://localhost:3000',
version: '*'
});
client.get('/data', function (err, req) {
if (err) {
return console.log (err);
}
req.on('result', function (err, res) {
if (err) {
return console.log (err);
}
oboe(res)
.node('!.*', function (n) {
console.log(n);
})
.fail(function (err) {
console.log(err);
})
.done(function (all) {
console.log(all);
console.log('done');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment