Express 4.14 – How to send 200 status with a custom message?

You can use:

res.status(200).send('some text');

if you want to pass number to the send method, convert it to string first to avoid deprecation error message.

the deprecation is for sending status directly inside send.

res.send(200) // <- is deprecated

BTW – the default status is 200, so you can simply use res.send(‘Success 1’).
Use .status() only for other status codes

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)