diff options
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 28 |
1 files changed, 12 insertions, 16 deletions
@@ -14,7 +14,7 @@ var WebSocketServer = require('ws').Server | |||
14 | var app = express() | 14 | var app = express() |
15 | 15 | ||
16 | // ----------- Checker ----------- | 16 | // ----------- Checker ----------- |
17 | var checker = require('./initializers/checker') | 17 | var checker = require('./server/initializers/checker') |
18 | 18 | ||
19 | var miss = checker.checkConfig() | 19 | var miss = checker.checkConfig() |
20 | if (miss.length !== 0) { | 20 | if (miss.length !== 0) { |
@@ -25,16 +25,16 @@ checker.createDirectoriesIfNotExist() | |||
25 | 25 | ||
26 | // ----------- PeerTube modules ----------- | 26 | // ----------- PeerTube modules ----------- |
27 | var config = require('config') | 27 | var config = require('config') |
28 | var constants = require('./initializers/constants') | 28 | var constants = require('./server/initializers/constants') |
29 | var customValidators = require('./helpers/customValidators') | 29 | var customValidators = require('./server/helpers/customValidators') |
30 | var database = require('./initializers/database') | 30 | var database = require('./server/initializers/database') |
31 | var logger = require('./helpers/logger') | 31 | var logger = require('./server/helpers/logger') |
32 | var peertubeCrypto = require('./helpers/peertubeCrypto') | 32 | var peertubeCrypto = require('./server/helpers/peertubeCrypto') |
33 | var poolRequests = require('./lib/poolRequests') | 33 | var poolRequests = require('./server/lib/poolRequests') |
34 | var routes = require('./controllers') | 34 | var routes = require('./server/controllers') |
35 | var utils = require('./helpers/utils') | 35 | var utils = require('./server/helpers/utils') |
36 | var videos = require('./lib/videos') | 36 | var videos = require('./server/lib/videos') |
37 | var webtorrent = require('./lib/webtorrent') | 37 | var webtorrent = require('./server/lib/webtorrent') |
38 | 38 | ||
39 | // Get configurations | 39 | // Get configurations |
40 | var port = config.get('listen.port') | 40 | var port = config.get('listen.port') |
@@ -67,11 +67,7 @@ app.use(require('connect-livereload')({ | |||
67 | require('segfault-handler').registerHandler() | 67 | require('segfault-handler').registerHandler() |
68 | 68 | ||
69 | // Static files | 69 | // Static files |
70 | app.use(express.static(path.join(__dirname, '/public'), { maxAge: 0 })) | 70 | app.use(express.static(path.join(__dirname, '/app'), { maxAge: 0 })) |
71 | |||
72 | // Jade template from ./views directory | ||
73 | app.set('views', path.join(__dirname, '/views')) | ||
74 | app.set('view engine', 'jade') | ||
75 | 71 | ||
76 | // API routes | 72 | // API routes |
77 | var api_route = '/api/' + constants.API_VERSION | 73 | var api_route = '/api/' + constants.API_VERSION |