mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
vhost start
This commit is contained in:
parent
6a71982677
commit
5095d83558
2 changed files with 23 additions and 11 deletions
26
server.js
26
server.js
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue