2020-04-14 18:46:31 +03: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) => {
|
|
|
|
res.sendFile(__dirname + '/public/index.html');
|
|
|
|
});
|
|
|
|
|
|
|
|
https.createServer({
|
2020-06-13 11:19:39 +03:00
|
|
|
key: fs.readFileSync(__dirname + '/certs/server-key.pem'),
|
|
|
|
cert: fs.readFileSync(__dirname + '/certs/server-cert.pem')
|
2020-04-14 18:46:31 +03:00
|
|
|
}, app).listen(9001, () => {
|
|
|
|
console.log('Listening...');
|
|
|
|
});
|