mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
use admin routes registering basepath from registration method instead of configuration
Signed-off-by: dswbx <dennis.senn@gmx.ch>
This commit is contained in:
@@ -29,7 +29,7 @@ export type CreateAppConfig = {
|
|||||||
};
|
};
|
||||||
initialConfig?: InitialModuleConfigs;
|
initialConfig?: InitialModuleConfigs;
|
||||||
plugins?: AppPlugin<any>[];
|
plugins?: AppPlugin<any>[];
|
||||||
options?: ModuleManagerOptions;
|
options?: Omit<ModuleManagerOptions, "initial" | "onUpdated">;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AppConfig = InitialModuleConfigs;
|
export type AppConfig = InitialModuleConfigs;
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ import * as SystemPermissions from "modules/permissions";
|
|||||||
|
|
||||||
const htmlBkndContextReplace = "<!-- BKND_CONTEXT -->";
|
const htmlBkndContextReplace = "<!-- BKND_CONTEXT -->";
|
||||||
|
|
||||||
|
// @todo: add migration to remove admin path from config
|
||||||
export type AdminControllerOptions = {
|
export type AdminControllerOptions = {
|
||||||
|
basepath?: string;
|
||||||
html?: string;
|
html?: string;
|
||||||
forceDev?: boolean;
|
forceDev?: boolean;
|
||||||
};
|
};
|
||||||
@@ -25,8 +27,12 @@ export class AdminController implements ClassController {
|
|||||||
return this.app.modules.ctx();
|
return this.app.modules.ctx();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get basepath() {
|
||||||
|
return this.options.basepath ?? "/";
|
||||||
|
}
|
||||||
|
|
||||||
private withBasePath(route: string = "") {
|
private withBasePath(route: string = "") {
|
||||||
return (this.app.modules.configs().server.admin.basepath + route).replace(/\/+$/, "/");
|
return (this.basepath + route).replace(/\/+$/, "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
getController(): Hono<any> {
|
getController(): Hono<any> {
|
||||||
|
|||||||
Reference in New Issue
Block a user