Files
bamboo/extend/api/index.js
T
2022-06-03 15:18:47 +08:00

14 lines
288 B
JavaScript

/**
* 加载api路由
* 加载app/api目录下的文件到路由
*/
const config = require("./config")
module.exports = async (app) => {
let list = await app.load(config.path)
list.forEach(item => {
app.use(async (ctx, next) => {
return await item.res.fun(ctx, next)
})
})
}