node.js - Terminate ExpressJS request -


how end express 3 request? res.end() doesn't stop processing.

exports.home = function(req, res) {   res.end();   console.log('still going, going...'); 

you'll need return. e.g.,

exports.home = function(req, res) {   return res.end();   console.log('i never run...'); 

res.end() completes , flushes response client. other action, however, doesn't tell javascript stop running need explicitly return out of function (although might ask question of why have code after flushing response don't want run...?).


Comments