routing-controllers
Version:
Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
18 lines • 525 B
JavaScript
import { getMetadataArgsStorage } from '../index';
/**
* Injects a Koa's Context object to the controller action parameter.
* Must be applied on a controller action parameter.
*/
export function Ctx() {
return function (object, methodName, index) {
getMetadataArgsStorage().params.push({
type: 'context',
object: object,
method: methodName,
index: index,
parse: false,
required: false,
});
};
}
//# sourceMappingURL=Ctx.js.map