I have a question regarding the APIs. Why express does not implement Node.js style callbacks, i.e., Error-First Callbacks?
For example, router.METHOD:
router.get('/', function(req, res){
res.send('hello world');
});
And furthermore, I also saw this Error handling:
app.use(function (err, req, res, next) {
// logic
})
Then, my question is: after add the Error Handling middleware as above, can I regard my code as following?
router.get('/', function(err, req, res, next){
res.send('hello world');
});
If so, I am able to use Q.denodeify converting the callback style to promise style right? Because Q.denodeify, as stated here, only deals with Node.js style (err, result) callback APIs
I have a question regarding the APIs. Why express does not implement Node.js style callbacks, i.e., Error-First Callbacks?
For example, router.METHOD:
And furthermore, I also saw this Error handling:
Then, my question is: after add the Error Handling middleware as above, can I regard my code as following?
If so, I am able to use Q.denodeify converting the callback style to promise style right? Because
Q.denodeify, as stated here, only deals with Node.js style(err, result)callback APIs