feat: add export and import

This commit is contained in:
2024-10-25 19:41:01 +08:00
parent 6f0faba703
commit 158b12d811
10 changed files with 115 additions and 17 deletions

View File

@@ -81,4 +81,13 @@ export class App<T = {}> {
const router = this.router;
return await router.parse(message, ctx);
}
exportRoutes() {
return this.router.exportRoutes();
}
importRoutes(routes: any[]) {
this.router.importRoutes(routes);
}
importApp(app: App) {
this.importRoutes(app.exportRoutes());
}
}