express-async-router-handler

1.0.1 • Public • Published

Module to handle all async routes in dict of express routers to pass their errors to express error handler.

Installation:

npm install express-async-router-handler

Usage:

const routerHandler = require('express-async-router-handler')
module.exports = (app) => {
  let routers = { 
    // Some functions exporting express.Router instance
    fooRouter: require('./foo')(app),
    barRouter: require('./bar')(app),
  }
  return routerHandler(routers)
}
 

Based on express-async-handler by Alexei Bazhenov

Package Sidebar

Install

npm i express-async-router-handler

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

2.81 kB

Total Files

5

Last publish

Collaborators

  • rooh1622