aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
Diffstat (limited to 'server.js')
-rw-r--r--server.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/server.js b/server.js
index 6eb022000..e54ffe69f 100644
--- a/server.js
+++ b/server.js
@@ -17,10 +17,9 @@ const app = express()
17 17
18// ----------- Database ----------- 18// ----------- Database -----------
19const constants = require('./server/initializers/constants') 19const constants = require('./server/initializers/constants')
20const database = require('./server/initializers/database')
21const logger = require('./server/helpers/logger') 20const logger = require('./server/helpers/logger')
22 21// Initialize database and models
23database.connect() 22const db = require('./server/initializers/database')
24 23
25// ----------- Checker ----------- 24// ----------- Checker -----------
26const checker = require('./server/initializers/checker') 25const checker = require('./server/initializers/checker')
@@ -39,9 +38,7 @@ if (errorMessage !== null) {
39const customValidators = require('./server/helpers/custom-validators') 38const customValidators = require('./server/helpers/custom-validators')
40const installer = require('./server/initializers/installer') 39const installer = require('./server/initializers/installer')
41const migrator = require('./server/initializers/migrator') 40const migrator = require('./server/initializers/migrator')
42const mongoose = require('mongoose')
43const routes = require('./server/controllers') 41const routes = require('./server/controllers')
44const Request = mongoose.model('Request')
45 42
46// ----------- Command line ----------- 43// ----------- Command line -----------
47 44
@@ -130,7 +127,7 @@ installer.installApplication(function (err) {
130 // ----------- Make the server listening ----------- 127 // ----------- Make the server listening -----------
131 server.listen(port, function () { 128 server.listen(port, function () {
132 // Activate the pool requests 129 // Activate the pool requests
133 Request.activate() 130 db.Request.activate()
134 131
135 logger.info('Server listening on port %d', port) 132 logger.info('Server listening on port %d', port)
136 logger.info('Webserver: %s', constants.CONFIG.WEBSERVER.URL) 133 logger.info('Webserver: %s', constants.CONFIG.WEBSERVER.URL)