Skip to content

Instantly share code, notes, and snippets.

@zontafil
Created September 2, 2015 19:30
Show Gist options
  • Select an option

  • Save zontafil/04169279055c5d1cb736 to your computer and use it in GitHub Desktop.

Select an option

Save zontafil/04169279055c5d1cb736 to your computer and use it in GitHub Desktop.
var q = require("q");
module.exports = {
test: function(req,res){
q()
.then(function(){
return func1();
})
.then(function(){
res.send("ok!!!")
})
.catch(res.serverError);
}
};
function func1(){
return q.promise(function(resolve,reject){
q()
.then(function(){
lol.copter();
resolve();
})
.catch(reject);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment