vhost start

This commit is contained in:
YourFriendlyNeighborhoodDealer 2019-08-14 09:30:51 +02:00
parent 6a71982677
commit 5095d83558
2 changed files with 23 additions and 11 deletions

View file

@ -27,8 +27,8 @@ const bodyParser = require('body-parser')
const busboy = require('connect-busboy')
const fs = require('fs')
const app = express()
const http = require('http')
const https = require('https')
// const http = require('http')
// const https = require('https')
const logger = require('./logger.js')
const utils = require('./utils.js')
@ -316,16 +316,20 @@ app.post('*', function (req, res) {
var msg = ''
stat.Load()
const httpServer = http.createServer(app)
httpServer.listen(port)
// const httpServer = http.createServer(app)
// httpServer.listen(port)
exports.app = app
msg += 'Server listening on port ' + port + ' (http)'
if (startHTTPS && certsLoaded) {
const httpsServer = https.createServer(certs, app)
httpsServer.listen(httpsPort)
msg += ', and ' + httpsPort + ' (https)...'
} else {
logger.Log('Cert files does not exists, starting http only!', logger.GetColor('redbg'))
}
// if (startHTTPS && certsLoaded) {
// const httpsServer = https.createServer(certs, app)
// httpsServer.listen(httpsPort)
// msg += ', and ' + httpsPort + ' (https)...'
// } else {
// logger.Log('Cert files does not exists, starting http only!', logger.GetColor('redbg'))
// }
logger.Log(msg, logger.GetColor('yellow'))
logger.Log('Node version: ' + process.version)