StatusHTTP
The StatusHTTP enum provides named constants for common HTTP status codes. Use them in route options for cleaner code.
Usage
Example TypeScript
import { StatusHTTP } from '@abrahambass/nova';
@Post('', { statusCode: StatusHTTP.CREATED }) // 201
async create() { ... }
@Delet('/:id', { statusCode: StatusHTTP.NO_CONTENT }) // 204
async remove() { ... } All Status Codes
| Name | Code | Category |
|---|---|---|
CONTINUE | 100 | Informational |
SWITCHING_PROTOCOLS | 101 | Informational |
PROCESSING | 102 | Informational |
OK | 200 | Success |
CREATED | 201 | Success |
ACCEPTED | 202 | Success |
NO_CONTENT | 204 | Success |
MOVED_PERMANENTLY | 301 | Redirection |
FOUND | 302 | Redirection |
NOT_MODIFIED | 304 | Redirection |
BAD_REQUEST | 400 | Client Error |
UNAUTHORIZED | 401 | Client Error |
FORBIDDEN | 403 | Client Error |
NOT_FOUND | 404 | Client Error |
METHOD_NOT_ALLOWED | 405 | Client Error |
CONFLICT | 409 | Client Error |
INTERNAL_SERVER_ERROR | 500 | Server Error |
NOT_IMPLEMENTED | 501 | Server Error |
BAD_GATEWAY | 502 | Server Error |
SERVICE_UNAVAILABLE | 503 | Server Error |