|
|
|
@ -22,9 +22,12 @@ app.get('/', (req, res) => {
@@ -22,9 +22,12 @@ app.get('/', (req, res) => {
|
|
|
|
|
|
|
|
|
|
const server = useHttp ? http : https; |
|
|
|
|
|
|
|
|
|
server.createServer({ |
|
|
|
|
key: fs.readFileSync(__dirname + '/certs/server-key.pem'), |
|
|
|
|
cert: fs.readFileSync(__dirname + '/certs/server-cert.pem') |
|
|
|
|
}, app).listen(port, () => { |
|
|
|
|
let options = {}; |
|
|
|
|
if(!useHttp) { |
|
|
|
|
options.key = fs.readFileSync(__dirname + '/certs/server-key.pem'); |
|
|
|
|
options.cert = s.readFileSync(__dirname + '/certs/server-cert.pem'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
server.createServer(options, app).listen(port, () => { |
|
|
|
|
console.log('Listening port:', port, 'folder:', publicFolderName); |
|
|
|
|
}); |