Sunday, 19 March 2017

How to remove appended HTTP Code in the Error Response Message by ExpressJS

I am using Express JS of nodejs

While sending an internal error message to browser using this code:

res.status(500).send('Something happen');

I check the response body in the dev tool, and it looks like this:

{"message":"500 - \"Something happen\""}

How to remove the status code 500 from the message?



via Carlos Galo Campos

No comments:

Post a Comment