UNPKG

@ark7/router

Version:
25 lines (23 loc) 722 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.A7Controller = void 0; require("reflect-metadata"); const declarations_1 = require("./declarations"); /** * Base class of the Ark7 Controller. */ class A7Controller { $_koaRouter; get $koaRouter() { if (this.$_koaRouter == null) { const meta = Reflect.getMetadata(declarations_1.METADATA_KEY, this.constructor); this.$_koaRouter = meta?.koaRouter(this); } return this.$_koaRouter; } get $koaRouterUseArgs() { return [this.$koaRouter.routes(), this.$koaRouter.allowedMethods()]; } } exports.A7Controller = A7Controller; //# sourceMappingURL=controller.js.map