Back to Expressjs

Res Status

_includes/api/en/4x/res-status.md

latest319 B
Original Source
<h3 id='res.status'>res.status(code)</h3>

Sets the HTTP status for the response. It is a chainable alias of Node's response.statusCode.

js
res.status(403).end()
res.status(400).send('Bad Request')
res.status(404).sendFile('/absolute/path/to/404.png')