2020-04-14 17:46:31 +02:00
|
|
|
const compression = require('compression');
|
|
|
|
const express = require('express');
|
|
|
|
const https = require('https');
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
const app = express();
|
|
|
|
|
|
|
|
app.use(compression());
|
|
|
|
app.use(express.static('public'));
|
|
|
|
|
|
|
|
app.get('/', (req, res) => {
|
2020-06-21 14:25:17 +02:00
|
|
|
res.sendFile(__dirname + '/public3/index.html');
|
2020-04-14 17:46:31 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
https.createServer({
|
2020-06-13 10:19:39 +02:00
|
|
|
key: fs.readFileSync(__dirname + '/certs/server-key.pem'),
|
|
|
|
cert: fs.readFileSync(__dirname + '/certs/server-cert.pem')
|
2020-08-22 22:48:00 +02:00
|
|
|
}, app).listen(443/* 9001 */, () => {
|
2020-04-14 17:46:31 +02:00
|
|
|
console.log('Listening...');
|
|
|
|
});
|