数据库插件
This commit is contained in:
+13
-2
@@ -14,6 +14,7 @@ module.exports = class Bamboo extends Koa {
|
||||
this.xe = xe
|
||||
this.root = this.isPath() || root;
|
||||
this.extend_directory = extend_directory || `extend/*/index.js`
|
||||
this.willReadyList = []
|
||||
console.log(`当前根目录${this.root}`);
|
||||
console.log(`当前插件目录${this.extend_directory}`);
|
||||
this.loadEvent()
|
||||
@@ -25,7 +26,18 @@ module.exports = class Bamboo extends Koa {
|
||||
for (let listElement of list) {
|
||||
await listElement.res(this)
|
||||
}
|
||||
this.startServer()
|
||||
this.willReadyList.push(()=>{
|
||||
this.startServer()
|
||||
})
|
||||
await this.willReady()
|
||||
}
|
||||
|
||||
|
||||
/*扩展已经加载完成触发*/
|
||||
async willReady() {
|
||||
for (let WRL of this.willReadyList) {
|
||||
WRL()
|
||||
}
|
||||
}
|
||||
|
||||
/*当前根目录*/
|
||||
@@ -58,7 +70,6 @@ module.exports = class Bamboo extends Koa {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*启动服务*/
|
||||
startServer(prod) {
|
||||
this.listen(prod || 3000)
|
||||
|
||||
Reference in New Issue
Block a user