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