Reverting back from pp.use to pp.get but adding some debugging to see if I can find a path forward
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 39s
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 39s
This commit is contained in:
parent
026bf3d205
commit
33511adf1c
1 changed files with 6 additions and 4 deletions
|
|
@ -78,10 +78,12 @@ export function Controller<T extends { new (...args: any[]): BaseController }>()
|
||||||
const path = Reflect.getMetadata(GET_METADATA_KEY, target.prototype, method);
|
const path = Reflect.getMetadata(GET_METADATA_KEY, target.prototype, method);
|
||||||
|
|
||||||
// Bind the method to the class instance
|
// Bind the method to the class instance
|
||||||
app.use((req, res, next) => {
|
app.get(path, (req, res, next) => {
|
||||||
if(req.path === path && req.method === 'GET') {
|
console.log('[Controller.setup.<GET request>] Request:', req);
|
||||||
|
console.log('[Controller.setup.<GET request>] Response:', res);
|
||||||
|
console.log('[Controller.setup.<GET request>] Next:', next);
|
||||||
|
|
||||||
return fn.bind(controller)(req, res, next);
|
return fn.bind(controller)(req, res, next);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue