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 are using res.send()
or res.json()
twice in the same request
this send the headers first, followed by body of the response and then headers again.
req.next
is usually not a function, next
is rather passed as a third argument of the middleware. Use that if you want to drop to the next middleware. (assuming you are using Express framework)