Created
September 17, 2014 14:08
-
-
Save adrai/9b95c881fcd3dd489264 to your computer and use it in GitHub Desktop.
oboe + restify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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