Attempting to handle async properly under this new wrapping strategy in the hope that makes both async and normal functions act consistently
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 43s
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 43s
This commit is contained in:
parent
56f5cc2cff
commit
0305f5eaeb
1 changed files with 2 additions and 2 deletions
|
|
@ -78,12 +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.get(path, (req, res, next) => {
|
||||
app.get(path, async (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);
|
||||
return await fn.bind(controller)(req, res, next);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue