Add redirection from http to https

This commit is contained in:
aterox
2022-03-07 05:50:24 -05:00
parent 93911c2520
commit 6ee5286ebf
3 changed files with 42 additions and 24 deletions

View File

@@ -66,6 +66,8 @@ const printWarning = (msg, error) => {
const method = (m, mw) => (req, res, next) => (req.method === m ? mw(req, res, next) : next());
const app = express()
// Load SSL redirection middleware
.use(sslServer.middleware)
// Serves up static files
.use(express.static(path.join(__dirname, 'dist')))
.use(express.static(path.join(__dirname, 'public')))
@@ -128,4 +130,4 @@ http.createServer(app)
});
/* Check, and if possible start SSL server too */
sslServer(app);
sslServer.startSSLServer(app);