routing-controllers
Version:
Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
25 lines • 834 B
JavaScript
import { getFromContainer } from '../container';
/**
* Middleware metadata.
*/
export class MiddlewareMetadata {
// -------------------------------------------------------------------------
// Constructor
// -------------------------------------------------------------------------
constructor(args) {
this.global = args.global;
this.target = args.target;
this.priority = args.priority;
this.type = args.type;
}
// -------------------------------------------------------------------------
// Accessors
// -------------------------------------------------------------------------
/**
* Gets middleware instance from the container.
*/
get instance() {
return getFromContainer(this.target);
}
}
//# sourceMappingURL=MiddlewareMetadata.js.map