mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-22 01:02:00 -07:00
15 lines
370 B
JavaScript
15 lines
370 B
JavaScript
import { Glob } from 'glob'
|
|
|
|
exports = module.exports = function Controllers(app) {
|
|
new Glob(`${__dirname}/*.js`, { ignore: '**/index.js' }, (err, matches) => {
|
|
if (err) { throw err }
|
|
|
|
matches.forEach((file) => {
|
|
const controller = require(file).default
|
|
app
|
|
.use(controller.routes())
|
|
.use(controller.allowedMethods())
|
|
})
|
|
})
|
|
}
|