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

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

php - HTTP_REFERER woes: How can I allow access to a specific page, only when a visitor has visited another specific page beforehand? -