1.0.3 • Published 5 years ago
experror v1.0.3
Experror
Express.js middleware for HTTP error response objects
Installation
$ npm i experror
Usage
const app = require('express')()
const experror = require('experror')
app.use(experror)
app.get('/', (req, res) => res.error(404, 'Custom message'))
app.listen(8081)
Sample response
{
"status": 503,
"error": "ServiceUnavailable",
"message": "Service unavailable"
}