diff options
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -35,7 +35,9 @@ | |||
35 | 35 | ||
36 | // ----------- PeerTube modules ----------- | 36 | // ----------- PeerTube modules ----------- |
37 | var config = require('config') | 37 | var config = require('config') |
38 | var customValidators = require('./src/customValidators') | ||
38 | var logger = require('./src/logger') | 39 | var logger = require('./src/logger') |
40 | var poolRequests = require('./src/poolRequests') | ||
39 | var routes = require('./routes') | 41 | var routes = require('./routes') |
40 | var videos = require('./src/videos') | 42 | var videos = require('./src/videos') |
41 | var webtorrent = require('./src/webTorrentNode') | 43 | var webtorrent = require('./src/webTorrentNode') |
@@ -56,7 +58,9 @@ | |||
56 | app.use(multer({ dest: uploads })) | 58 | app.use(multer({ dest: uploads })) |
57 | app.use(bodyParser.urlencoded({ extended: false })) | 59 | app.use(bodyParser.urlencoded({ extended: false })) |
58 | // Validate some params for the API | 60 | // Validate some params for the API |
59 | app.use(expressValidator()) | 61 | app.use(expressValidator({ |
62 | customValidators: customValidators | ||
63 | })) | ||
60 | 64 | ||
61 | // ----------- Views, routes and static files ----------- | 65 | // ----------- Views, routes and static files ----------- |
62 | 66 | ||
@@ -154,6 +158,9 @@ | |||
154 | 158 | ||
155 | // ----------- Make the server listening ----------- | 159 | // ----------- Make the server listening ----------- |
156 | server.listen(port, function () { | 160 | server.listen(port, function () { |
161 | // Activate the pool requests | ||
162 | poolRequests.activate() | ||
163 | |||
157 | videos.seedAll(function () { | 164 | videos.seedAll(function () { |
158 | logger.info('Seeded all the videos') | 165 | logger.info('Seeded all the videos') |
159 | logger.info('Server listening on port %d', port) | 166 | logger.info('Server listening on port %d', port) |