Mapping of HTTP Status Messages in Node.js
View on Twitter
💡 Want to send a message along with an HTTP status code response?
👉🏼 @nodejs has a built-in mapping of HTTP status codes and their respective messages.
![The STATUS_CODES (uppercase) object of the http module has a mapping of status code to status message (e.g. STATUS_CODES[404]).](/images/tips/using-status-codes-mapping-nodejs.jpg)
![Node.js mapping of status codes and their corresponding message.](/images/tips/status-code-to-message-mapping-nodejs.jpg)
💡 Want to send a message along with an HTTP status code response?
👉🏼 @nodejs has a built-in mapping of HTTP status codes and their respective messages.