From fd484a217c77dba42c29fae1cfdb2390422da847 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 25 Jun 2020 21:25:18 +0300 Subject: feat: add logger and handle eveyrthing nicely --- services/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'services/index.ts') diff --git a/services/index.ts b/services/index.ts index 8d77429..bdce04f 100644 --- a/services/index.ts +++ b/services/index.ts @@ -7,6 +7,7 @@ import Auth from './auth/auth.service'; import tryAuthenticate from '../hooks/tryAuthenticate'; import logging from '../hooks/logging'; +import handleErrors from '../hooks/handleErrors'; export default (app: Application): void => { app.configure(Auth); @@ -17,10 +18,10 @@ export default (app: Application): void => { app.hooks({ before: { - all: tryAuthenticate + all: [tryAuthenticate, logging] }, - after: { - all: logging + error: { + all: handleErrors } }); }; -- cgit v1.2.3