Skip to content

Instantly share code, notes, and snippets.

@dburrows
Created April 4, 2014 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dburrows/9972975 to your computer and use it in GitHub Desktop.
Save dburrows/9972975 to your computer and use it in GitHub Desktop.
var Q = require('q');
var HTTP = require("q-io/http");
Q.all( [
HTTP.request('https://mathstracker.co.uk/').timeout(5000).then(getStatus),
HTTP.request('http://mammal.io/').timeout(5000).then(getStatus)
])
.then(function(resStatusArray) {
console.log(resStatusArray);
})
.fail(function(error){
console.log(error);
});
function getStatus(res) {
return res.status;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment