数据库插件
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* 加载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)
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user