0.0.1-beta.1 • Published 2 years ago
@hndlr/erred v0.0.1-beta.1
@hndlr/erred
Usage
Slot this code with express to handle errors and turn them into readable JSON objects
const express = require('express')
const { NotFound } = require('@hndlr/errors')
const app = express()
const port = 3000
app.get('*', (req, res, next) => {
return next(new NotFound(`Could not find ${req.url}`))
})
app.use(require('@hndlr/erred')())
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
})
0.1.0-beta.3
2 years ago
0.1.0-beta.2
2 years ago
0.1.0-beta.1
2 years ago
0.0.1-beta.2
4 years ago
0.0.1-beta.1
5 years ago