aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
Diffstat (limited to 'server.js')
-rw-r--r--server.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/server.js b/server.js
index 63aeb7145..33e34019d 100644
--- a/server.js
+++ b/server.js
@@ -21,24 +21,26 @@ if (miss.length !== 0) {
21 throw new Error('Miss some configurations keys : ' + miss) 21 throw new Error('Miss some configurations keys : ' + miss)
22} 22}
23 23
24// ----------- PeerTube modules ----------- 24// ----------- Database -----------
25const config = require('config') 25const config = require('config')
26const constants = require('./server/initializers/constants') 26const constants = require('./server/initializers/constants')
27const customValidators = require('./server/helpers/customValidators')
28const database = require('./server/initializers/database') 27const database = require('./server/initializers/database')
29const installer = require('./server/initializers/installer')
30const logger = require('./server/helpers/logger') 28const logger = require('./server/helpers/logger')
31const poolRequests = require('./server/lib/requestsScheduler') 29
30database.connect()
31
32// ----------- PeerTube modules -----------
33const customValidators = require('./server/helpers/customValidators')
34const installer = require('./server/initializers/installer')
35const mongoose = require('mongoose')
32const routes = require('./server/controllers') 36const routes = require('./server/controllers')
33const utils = require('./server/helpers/utils') 37const utils = require('./server/helpers/utils')
34const webtorrent = require('./server/lib/webtorrent') 38const webtorrent = require('./server/lib/webtorrent')
39const Request = mongoose.model('Request')
35 40
36// Get configurations 41// Get configurations
37const port = config.get('listen.port') 42const port = config.get('listen.port')
38 43
39// ----------- Database -----------
40database.connect()
41
42// ----------- Command line ----------- 44// ----------- Command line -----------
43 45
44// ----------- App ----------- 46// ----------- App -----------
@@ -135,7 +137,7 @@ installer.installApplication(function (err) {
135 // ----------- Make the server listening ----------- 137 // ----------- Make the server listening -----------
136 server.listen(port, function () { 138 server.listen(port, function () {
137 // Activate the pool requests 139 // Activate the pool requests
138 poolRequests.activate() 140 Request.activate()
139 141
140 // videos.seedAllExisting(function () { 142 // videos.seedAllExisting(function () {
141 logger.info('Seeded all the videos') 143 logger.info('Seeded all the videos')