aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
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 () {