res.status() do in Express?res.status() sets the HTTP status code for the response sent to the client. It tells the browser or client if the request was successful, failed, or something else.
res.status()?You chain res.status(404) with .send() like this: res.status(404).send('Not Found'). This sets the status and sends the message.
Correct status codes help the client understand what happened. For example, 200 means success, 404 means not found, and 500 means server error. This helps browsers and APIs handle responses properly.
res.status() with other response methods? Give an example.Yes, you can chain it with methods like .json(), .send(), or .end(). Example: res.status(201).json({ message: 'Created' }) sends a 201 status with JSON data.
res.status() in Express?The default status code is 200, which means the request was successful.
res.status(500) indicate?Status code 500 means there was a server error.
You set the status with res.status(201) and then send JSON with .json().
res.status(), what status code is sent by default?Express sends status 200 by default, meaning success.
res.status() to send a plain text response?res.send() sends a plain text or HTML response.
404 means the resource was not found.
res.status() to send a 403 Forbidden response with a message.