I\'m not really sure why I\'m getting this error. It\'s a simple API built on express.js to be able to add and remove posts. The error occurs when I trigger the delete route
You need to add the 'return' so that you don't reply twice.
// save post and check for errors post.save(function(err) { if (err) { return res.send(); } res.json({ message: 'post created!' }); });