ControllerMethodArgs(...desirableParams: ControllerMethodArg[]): unknown
Decorator that should be used on the Controller Method when we need to refer to the request body, param, query, etc. in the Method Body
▶Example 1
Example 1
(@)Controller("/api/v1") class MyClass { (@)Post("/:resource") (@)ControllerMethodArgs("body", "query", "param") doSomething(body, query, param, ctx): void { console.log(`endpoint called: /api/v1/${ctx.params.resource}`); console.log(`now let's do something with`, body, query, param); } }
...desirableParams: ControllerMethodArg[]