npm

express-error-page

0.2.0 • Public • Published

express-error-page

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.

Who uses it?

Nucleus ElioPay Backery Lttrfeed

👋 Want to be listed there? Contact me.

Features

  • Telegram alerts on bugs
  • Change the page background
  • Add custom CSS
  • Respond in JSON if API detected

How to use

npm install express-error-page

Then require the module

const errorsHandler = require('express-error-page')({
	background: 'red', // Can be any valid CSS background property value
	customCSS: 'body {color: #000}', 
})

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

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

Readme

Keywords

none

Package Sidebar

Install

npm i express-error-page

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

4.66 kB

Total Files

3

Last publish

Collaborators

  • vincelwt