-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
35 lines (30 loc) · 913 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict';
const logger = require('./src/utils/logger');
const express = require('express');
const config = require('./src/config/configuration');
const app = express();
//Input Validation
const Celebrate = require('celebrate');
//Setup app with defaults
let server = require('./src/server/server')(app, config);
server.init(app, config)
.then(function () {
return server.setupSession();
})
.then(function () {
const testRoute = require('./src/routes/test/route')(app);
app.use('/api/test', testRoute);
})
.then(function () {
app.use(Celebrate.errors());
})
.then(function () {
require('./src/routes/additional_handlers/exception_handlers')(app);
})
.then(function () {
logger.log('info', 'System is up and running');
})
.catch(function (err) {
logger.log('error', err);
process.exit(-1);
});