[](https://buildkite.com/involves/nodejs-lib-express-router-tool) [

npm install @involves/express-router-tool --save
`Example usage
Router tool:
`javascript
const express = require('express')
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:
`javascript
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
``