UNPKG

routing-controllers

Version:

Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.

23 lines 779 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Controller = Controller; const index_1 = require("../index"); /** * Defines a class as a controller. * Each decorated controller method is served as a controller action. * Controller actions are executed when request come. * * @param baseRoute Extra path you can apply as a base route to all controller actions * @param options Extra options that apply to all controller actions */ function Controller(baseRoute, options) { return function (object) { (0, index_1.getMetadataArgsStorage)().controllers.push({ type: 'default', target: object, route: baseRoute, options, }); }; } //# sourceMappingURL=Controller.js.map