aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-02-05 18:03:20 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-02-05 18:03:20 +0100
commitdac0a5319ab1c52a0958647b1593f85339b77e29 (patch)
tree716bc9e7e0b9fd3a7066530e50e73991fb278d05 /server.js
parenta5fa04b0cce851f680a45055f57ed2c3d22f1c82 (diff)
downloadPeerTube-dac0a5319ab1c52a0958647b1593f85339b77e29.tar.gz
PeerTube-dac0a5319ab1c52a0958647b1593f85339b77e29.tar.zst
PeerTube-dac0a5319ab1c52a0958647b1593f85339b77e29.zip
Split utils file
Diffstat (limited to 'server.js')
-rw-r--r--server.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/server.js b/server.js
index 1153c9ef6..b8674b0b5 100644
--- a/server.js
+++ b/server.js
@@ -32,6 +32,7 @@
32 var customValidators = require('./helpers/customValidators') 32 var customValidators = require('./helpers/customValidators')
33 var database = require('./initializers/database') 33 var database = require('./initializers/database')
34 var logger = require('./helpers/logger') 34 var logger = require('./helpers/logger')
35 var peertubeCrypto = require('./helpers/peertubeCrypto')
35 var poolRequests = require('./lib/poolRequests') 36 var poolRequests = require('./lib/poolRequests')
36 var routes = require('./controllers') 37 var routes = require('./controllers')
37 var utils = require('./helpers/utils') 38 var utils = require('./helpers/utils')
@@ -117,7 +118,7 @@
117 // Prod : no stacktraces leaked to user 118 // Prod : no stacktraces leaked to user
118 if (process.env.NODE_ENV === 'production') { 119 if (process.env.NODE_ENV === 'production') {
119 app.use(function (err, req, res, next) { 120 app.use(function (err, req, res, next) {
120 logger.error('Error : ' + err.message, { error: err }) 121 logger.error(err)
121 res.status(err.status || 500) 122 res.status(err.status || 500)
122 res.render('error', { 123 res.render('error', {
123 message: err.message, 124 message: err.message,
@@ -126,7 +127,7 @@
126 }) 127 })
127 } else { 128 } else {
128 app.use(function (err, req, res, next) { 129 app.use(function (err, req, res, next) {
129 logger.error('Error : ' + err.message, { error: err }) 130 logger.error(err)
130 res.status(err.status || 500) 131 res.status(err.status || 500)
131 res.render('error', { 132 res.render('error', {
132 message: err.message, 133 message: err.message,
@@ -136,7 +137,7 @@
136 } 137 }
137 138
138 // ----------- Create the certificates if they don't already exist ----------- 139 // ----------- Create the certificates if they don't already exist -----------
139 utils.createCertsIfNotExist(function (err) { 140 peertubeCrypto.createCertsIfNotExist(function (err) {
140 if (err) throw err 141 if (err) throw err
141 // Create/activate the webtorrent module 142 // Create/activate the webtorrent module
142 webtorrent.create(function () { 143 webtorrent.create(function () {