mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
optimized module manager seeding, added type support for new api hooks and reduced amount of dist chunks
This commit is contained in:
@@ -37,6 +37,7 @@ export type AppConfig = InitialModuleConfigs;
|
||||
export class App<DB = any> {
|
||||
modules: ModuleManager;
|
||||
static readonly Events = AppEvents;
|
||||
adminController?: AdminController;
|
||||
|
||||
constructor(
|
||||
private connection: Connection,
|
||||
@@ -94,8 +95,12 @@ export class App<DB = any> {
|
||||
return this.modules.get(module).schema();
|
||||
}
|
||||
|
||||
get server() {
|
||||
return this.modules.server;
|
||||
}
|
||||
|
||||
get fetch(): any {
|
||||
return this.modules.server.fetch;
|
||||
return this.server.fetch;
|
||||
}
|
||||
|
||||
get module() {
|
||||
@@ -119,7 +124,8 @@ export class App<DB = any> {
|
||||
|
||||
registerAdminController(config?: AdminControllerOptions) {
|
||||
// register admin
|
||||
this.modules.server.route("/", new AdminController(this, config).getController());
|
||||
this.adminController = new AdminController(this, config);
|
||||
this.modules.server.route("/", this.adminController.getController());
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user