Service decorators - oh the evil I have wraught....

This commit is contained in:
2026-04-29 19:44:25 +01:00
parent 8bb18bce05
commit 532e7eac81
21 changed files with 1129 additions and 79 deletions
+19
View File
@@ -0,0 +1,19 @@
import Koa from "koa";
import {DecoratedRouterCollector} from "../core/router";
import {BaseService, service} from "../core/service";
@service('webserverService')
export default class WebserverService extends BaseService {
private app: Koa = new Koa();
add(router: any) {
DecoratedRouterCollector.bindRouterToApp(router, this.app);
}
listen(port: number = 8080) {
this.app.listen(port);
}
async init() {}
async destroy() {}
}