Monday 8 January 2018

Best practice to return on send in express?

Hi! I've been using express.js for quite some time.In our last project (pretty huge one) we've got 11 bugs related to code that accidentally gets executed after res.send() in expressjs routes.I am now looking for a best practice to avoid this in the future. An obvious solution is to always write return res.send(...), but this looks weird and unfamiliar to new developers, since the return value is discarded by Express.Is there a better solution?

Submitted January 08, 2018 at 10:35PM by smthamazing

No comments:

Post a Comment