diff --git a/src/decorators/Controller.ts b/src/decorators/Controller.ts index 4b41beb..e277ca2 100644 --- a/src/decorators/Controller.ts +++ b/src/decorators/Controller.ts @@ -78,13 +78,13 @@ export function Controller() 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.] Request:', req); console.log('[Controller.setup.] Response:', res); console.log('[Controller.setup.] Next:', next); try { - Promise.all([fn.bind(controller)(req, res, next)]) + await Promise.all([fn.bind(controller)(req, res, next)]) .catch((error) => { throw new Error(error) }); } catch(error) {