diff options
author | eug-vs <eug-vs@keemail.me> | 2020-06-25 21:25:18 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-06-25 21:25:18 +0300 |
commit | fd484a217c77dba42c29fae1cfdb2390422da847 (patch) | |
tree | b11c527bbc0a268f0361a4d56f6aff7011960f98 /services/index.ts | |
parent | 050d3e087b3ce2c9dd892a96daf215402292aa2c (diff) | |
download | which-api-fd484a217c77dba42c29fae1cfdb2390422da847.tar.gz |
feat: add logger and handle eveyrthing nicely
Diffstat (limited to 'services/index.ts')
-rw-r--r-- | services/index.ts | 7 |
1 files changed, 4 insertions, 3 deletions
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 } }); }; |