diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-06-28 20:10:32 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-06-28 20:10:32 +0200 |
commit | 00057e85a703713a8f0d96e01c49978be0987eb2 (patch) | |
tree | 54735435062d2ededa72448de9fcaa677cf2c79c /server.js | |
parent | aaf61f3810e6d57c5130af959bd2860df32775e7 (diff) | |
download | PeerTube-00057e85a703713a8f0d96e01c49978be0987eb2.tar.gz PeerTube-00057e85a703713a8f0d96e01c49978be0987eb2.tar.zst PeerTube-00057e85a703713a8f0d96e01c49978be0987eb2.zip |
Request model refractoring -> use mongoose api
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') |