re: Concept: High Performance web server w/ Promises VIEW POST

VIEW FULL DISCUSSION
 

Try this:

/* GET home page. */
router.get('/', function(req, res, next) {
  return new Promise(function(resolve, reject) {
    debug("GET /");
    resolve({ title: 'The Open Source U' }); //calculation or object
  })
  .then(function(payload) {
    res.render('site/index', payload)
  });
});
 

I'm replacing my previous comment about next. I think I see what you are pointing out. I'm revisiting this based on your feedback.

code of conduct - report abuse