aboutsummaryrefslogtreecommitdiff
path: root/services/index.ts
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-06-25 21:25:18 +0300
committereug-vs <eug-vs@keemail.me>2020-06-25 21:25:18 +0300
commitfd484a217c77dba42c29fae1cfdb2390422da847 (patch)
treeb11c527bbc0a268f0361a4d56f6aff7011960f98 /services/index.ts
parent050d3e087b3ce2c9dd892a96daf215402292aa2c (diff)
downloadwhich-api-fd484a217c77dba42c29fae1cfdb2390422da847.tar.gz
feat: add logger and handle eveyrthing nicely
Diffstat (limited to 'services/index.ts')
-rw-r--r--services/index.ts7
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
}
});
};