Package Exports
- http-status-codes
- http-status-codes/index
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (http-status-codes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
http-status-codes
Constants enumerating the HTTP status codes. Based on the Java Apache HttpStatus API.
All status codes defined in RFC1945 (HTTP/1.0), RFC2616 (HTTP/1.1), and RFC2518 (WebDAV) are supported.
Installation
npm install http-status-codesUsage (express 4.x)
var HttpStatus = require('http-status-codes');
response
.status(HttpStatus.OK)
.send('ok');
response
.status(HttpStatus.INTERNAL_SERVER_ERROR)
.send({
error: HttpStatus.getStatusText(HttpStatus.INTERNAL_SERVER_ERROR)
});