0.0.1-beta.1 • Published 8 months 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
8 months ago
0.1.0-beta.2
8 months ago
0.1.0-beta.1
8 months ago
0.0.1-beta.2
3 years ago
0.0.1-beta.1
4 years ago