diff options
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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 ----------- |
25 | const config = require('config') | 25 | const config = require('config') |
26 | const constants = require('./server/initializers/constants') | 26 | const constants = require('./server/initializers/constants') |
27 | const customValidators = require('./server/helpers/customValidators') | ||
28 | const database = require('./server/initializers/database') | 27 | const database = require('./server/initializers/database') |
29 | const installer = require('./server/initializers/installer') | ||
30 | const logger = require('./server/helpers/logger') | 28 | const logger = require('./server/helpers/logger') |
31 | const poolRequests = require('./server/lib/requestsScheduler') | 29 | |
30 | database.connect() | ||
31 | |||
32 | // ----------- PeerTube modules ----------- | ||
33 | const customValidators = require('./server/helpers/customValidators') | ||
34 | const installer = require('./server/initializers/installer') | ||
35 | const mongoose = require('mongoose') | ||
32 | const routes = require('./server/controllers') | 36 | const routes = require('./server/controllers') |
33 | const utils = require('./server/helpers/utils') | 37 | const utils = require('./server/helpers/utils') |
34 | const webtorrent = require('./server/lib/webtorrent') | 38 | const webtorrent = require('./server/lib/webtorrent') |
39 | const Request = mongoose.model('Request') | ||
35 | 40 | ||
36 | // Get configurations | 41 | // Get configurations |
37 | const port = config.get('listen.port') | 42 | const port = config.get('listen.port') |
38 | 43 | ||
39 | // ----------- Database ----------- | ||
40 | database.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') |