@involves/express-router-tool
v1.0.62
Published
[](https://buildkite.com/involves/nodejs-lib-express-router-tool) [
const { routerTool } = require('@involves/express-router-tool')
async function _controller(_req, res) {
res.end()
}
(() => {
const app = express()
const router = express.Router()
const ROUTE = '/'
routerTool.create(router, 'GET', ROUTE, _controller)
})()Default errors:
const { UnauthorizedError } = require('@involves/express-router-tool')
async function _controller(_req, res) {
throw new UnauthorizedError()
}List of Errors
| Error | Status Code | | ----------------------- |-------------| | BadRequestError | 400 | | ServiceUnavailableError | 503 | | UnauthorizedError | 401 | | ValidationError | 400 |
How to run the tests
At the terminal, just type the command:
npm run test