Start server without paths.

This commit is contained in:
SamTV12345 2023-06-25 16:49:17 +02:00
parent 798543fb45
commit 8926677a66
No known key found for this signature in database
GPG key ID: E63EEC7466038043
13 changed files with 2657 additions and 74 deletions

View file

@ -109,11 +109,15 @@ export const createServer = async () => {
'variable to production by using: export NODE_ENV=production');
}
};
export const app = express();
import http from 'http'
import https from 'https'
export const restartServer = async () => {
await closeServer();
const app = express(); // New syntax for express v3
// New syntax for express v3
if (ssl) {
console.log('SSL -- enabled');
@ -133,11 +137,8 @@ export const restartServer = async () => {
options.ca.push(fs.readFileSync(caFileName));
}
}
const https = require('https');
server = https.createServer(options, app);
} else {
const http = require('http');
server = http.createServer(app);
}