mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +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;
|
||||
plugins?: AppPlugin<any>[];
|
||||
options?: ModuleManagerOptions;
|
||||
options?: Omit<ModuleManagerOptions, "initial" | "onUpdated">;
|
||||
};
|
||||
|
||||
export type AppConfig = InitialModuleConfigs;
|
||||
|
||||
@@ -10,7 +10,9 @@ import * as SystemPermissions from "modules/permissions";
|
||||
|
||||
const htmlBkndContextReplace = "<!-- BKND_CONTEXT -->";
|
||||
|
||||
// @todo: add migration to remove admin path from config
|
||||
export type AdminControllerOptions = {
|
||||
basepath?: string;
|
||||
html?: string;
|
||||
forceDev?: boolean;
|
||||
};
|
||||
@@ -25,8 +27,12 @@ export class AdminController implements ClassController {
|
||||
return this.app.modules.ctx();
|
||||
}
|
||||
|
||||
get basepath() {
|
||||
return this.options.basepath ?? "/";
|
||||
}
|
||||
|
||||
private withBasePath(route: string = "") {
|
||||
return (this.app.modules.configs().server.admin.basepath + route).replace(/\/+$/, "/");
|
||||
return (this.basepath + route).replace(/\/+$/, "/");
|
||||
}
|
||||
|
||||
getController(): Hono<any> {
|
||||
|
||||
Reference in New Issue
Block a user