experror

1.0.3 • Public • Published

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"
}

Package Sidebar

Install

npm i experror

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

4.79 kB

Total Files

4

Last publish

Collaborators

  • vaaips