diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-06-25 22:19:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 22:19:15 +0300 |
commit | 2156cb4cb0d84d7f3905d97ef789c3f9fde22548 (patch) | |
tree | b11c527bbc0a268f0361a4d56f6aff7011960f98 /services | |
parent | 343a975413d8d3ce8194507017fb4ca01a4faf54 (diff) | |
parent | fd484a217c77dba42c29fae1cfdb2390422da847 (diff) | |
download | which-api-2156cb4cb0d84d7f3905d97ef789c3f9fde22548.tar.gz |
Merge pull request #12 from which-ecosystem/logging
Logging and exception handling
Diffstat (limited to 'services')
-rw-r--r-- | services/index.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/services/index.ts b/services/index.ts index ce20901..bdce04f 100644 --- a/services/index.ts +++ b/services/index.ts @@ -6,6 +6,8 @@ import Votes from './votes/votes.service'; 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); @@ -16,7 +18,10 @@ export default (app: Application): void => { app.hooks({ before: { - all: tryAuthenticate + all: [tryAuthenticate, logging] + }, + error: { + all: handleErrors } }); }; |