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

This commit is contained in:
Alan Bridgeman 2025-06-24 09:15:16 -05:00
parent 026bf3d205
commit 33511adf1c

View file

@ -78,10 +78,12 @@ export function Controller<T extends { new (...args: any[]): BaseController }>()
const path = Reflect.getMetadata(GET_METADATA_KEY, target.prototype, method);
// Bind the method to the class instance
app.use((req, res, next) => {
if(req.path === path && req.method === 'GET') {
return fn.bind(controller)(req, res, next);
}
app.get(path, (req, res, next) => {
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);
});
});