mirror of
https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service.git
synced 2026-09-21 16:52:03 -07:00
Mount middleware stack per route
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import glob from 'glob'
|
||||
import Router from 'koa-router'
|
||||
import convert from 'koa-convert'
|
||||
|
||||
exports = module.exports = function initModules(app) {
|
||||
glob(`${__dirname}/*`, { ignore: '**/index.js' }, (err, matches) => {
|
||||
@@ -19,7 +20,7 @@ exports = module.exports = function initModules(app) {
|
||||
controller
|
||||
} = props
|
||||
|
||||
router[method.toLowerCase()](route, controller)
|
||||
router[method.toLowerCase()](route, ...middleware, controller)
|
||||
|
||||
app
|
||||
.use(router.routes())
|
||||
|
||||
Reference in New Issue
Block a user