Merge pull request #126 from z-classic/hellcatz-patch-5

Update website.js
This commit is contained in:
Procrastinator 2017-04-23 14:58:56 -04:00 committed by GitHub
commit b8e60519ae
1 changed files with 7 additions and 7 deletions

View File

@ -326,12 +326,8 @@ module.exports = function(logger){
res.send(500, 'Something broke!');
});
try {
if (typeof portalConfig.website.tlsOptions !== 'undefined' && !portalConfig.website.tlsOptions.enabled) {
app.listen(portalConfig.website.port, portalConfig.website.host, function () {
logger.debug(logSystem, 'Server', 'Website started on ' + portalConfig.website.host + ':' + portalConfig.website.port);
});
} else {
try {
if (portalConfig.website.tlsOptions && portalConfig.website.tlsOptions.enabled === true) {
var TLSoptions = {
key: fs.readFileSync(portalConfig.website.tlsOptions.key),
cert: fs.readFileSync(portalConfig.website.tlsOptions.cert)
@ -339,7 +335,11 @@ module.exports = function(logger){
https.createServer(TLSoptions, app).listen(portalConfig.website.port, portalConfig.website.host, function() {
logger.debug(logSystem, 'Server', 'TLS Website started on ' + portalConfig.website.host + ':' + portalConfig.website.port);
});
});
} else {
app.listen(portalConfig.website.port, portalConfig.website.host, function () {
logger.debug(logSystem, 'Server', 'Website started on ' + portalConfig.website.host + ':' + portalConfig.website.port);
});
}
}
catch(e){