After calling res.send()
, is there a need to call a return or somehow exit the callback function in order to make sure no further code executes? Like how when calling a header function in PHP, you need to call exit after that to prevent further code from being executed.
app.post('/create', function(req, res) {
if(req.headers['x-api-key'] === undefined) {
res.send({msg: "Goodbye"});
}
// other code that should only be processed if it has that header.
});