0.2.3 • Published 4 years ago

express-error-block v0.2.3

Weekly downloads
8
License
MIT
Repository
github
Last release
4 years ago

express-error-block

npm version

A minimalsit simple error handler for Express (4+) which returns an error page.

Support error reporting via next() and handling of 404.

It renders a simple HTML page, which can be customised via options.

Features

  • Customise the page CSS
  • Respond in JSON if appropriate
  • Show a cute illustration
  • Hide error message in production
  • Telegram alerts on bugs

Who uses it?

👋 Want to be listed there? Contact me.

How to use

npm install express-error-block

Then require the module

const errorsHandler = require('express-error-block')({
	background: 'red', // Can be any valid CSS background property value
	customCSS: 'body {color: #000}', 
	noImage: false // Hide the default illustrations
})

And add the handlers at the end of your app (just before app.listen())

app.use(errorsHandler.handler)
app.use(errorsHandler.notFound)
0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

5 years ago