routing-controllers
Version:
Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
19 lines • 672 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Middleware = Middleware;
const index_1 = require("../index");
/**
* Marks given class as a middleware.
* Allows to create global middlewares and control order of middleware execution.
*/
function Middleware(options) {
return function (target) {
(0, index_1.getMetadataArgsStorage)().middlewares.push({
target: target,
type: options && options.type ? options.type : 'before',
global: true,
priority: options && options.priority !== undefined ? options.priority : 0,
});
};
}
//# sourceMappingURL=Middleware.js.map
;