aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-01-12 15:20:03 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-01-12 15:20:03 +0100
commit99fe265a5fc077cb66c322e7f3d191ff7110aea0 (patch)
treec9e04ccfcc5496d2300d7c26db5833e494b4cdad /server.js
parentfcc5f77b95d330bfcb439c172b7fcc58f3162e4d (diff)
parent91cc839af88730ba55f84997c56b85ea100070a7 (diff)
downloadPeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.tar.gz
PeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.tar.zst
PeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.zip
Merge branch 'postgresql'
Diffstat (limited to 'server.js')
-rw-r--r--server.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/server.js b/server.js
index 6eb022000..7503072af 100644
--- a/server.js
+++ b/server.js
@@ -17,10 +17,10 @@ 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')
23db.init()
24 24
25// ----------- Checker ----------- 25// ----------- Checker -----------
26const checker = require('./server/initializers/checker') 26const checker = require('./server/initializers/checker')
@@ -39,9 +39,7 @@ if (errorMessage !== null) {
39const customValidators = require('./server/helpers/custom-validators') 39const customValidators = require('./server/helpers/custom-validators')
40const installer = require('./server/initializers/installer') 40const installer = require('./server/initializers/installer')
41const migrator = require('./server/initializers/migrator') 41const migrator = require('./server/initializers/migrator')
42const mongoose = require('mongoose')
43const routes = require('./server/controllers') 42const routes = require('./server/controllers')
44const Request = mongoose.model('Request')
45 43
46// ----------- Command line ----------- 44// ----------- Command line -----------
47 45
@@ -59,7 +57,8 @@ app.use(expressValidator({
59 customValidators.misc, 57 customValidators.misc,
60 customValidators.pods, 58 customValidators.pods,
61 customValidators.users, 59 customValidators.users,
62 customValidators.videos 60 customValidators.videos,
61 customValidators.remote.videos
63 ) 62 )
64})) 63}))
65 64
@@ -130,7 +129,7 @@ installer.installApplication(function (err) {
130 // ----------- Make the server listening ----------- 129 // ----------- Make the server listening -----------
131 server.listen(port, function () { 130 server.listen(port, function () {
132 // Activate the pool requests 131 // Activate the pool requests
133 Request.activate() 132 db.Request.activate()
134 133
135 logger.info('Server listening on port %d', port) 134 logger.info('Server listening on port %d', port)
136 logger.info('Webserver: %s', constants.CONFIG.WEBSERVER.URL) 135 logger.info('Webserver: %s', constants.CONFIG.WEBSERVER.URL)