Express.js Routing error: Can't set headers after they are sent

前端 未结 6 2097
情歌与酒
情歌与酒 2020-12-01 05:35

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

6条回答
  •  情书的邮戳
    2020-12-01 06:23

    Just for the sake of completeness I will also mention that: Sometime problem may be in a the middleware you may be using by calling app.use.

    After checking for obvious errors as mentioned in previous answers:

    You should remove all the app.use statement then reintroduce them one by one, to find problematic module.

提交回复
热议问题