I have several Express applications, and I see that in some modules, res.end()
is called at the end of a request handler (after res.send
or res.json
), while in others, it isn't called.
For example:
app.get('/test', function(req, res) {
res.send('Test', 200);
});
or:
app.get('/test', function(req, res) {
res.send('Test', 200);
res.end();
});
Both cases work, but I'm afraid about leaks or running out file descriptors or something like that, when I run many requests. Which one is "more correct"?
res.send()
triggeredres.end()
-- could be wrong tho. – tymeJV Dec 3 '13 at 15:31