tweb-i2p/server.js
Eduard Kuzmenko cd04dc6b34 Pre-lags fix
2020-04-14 18:46:31 +03:00

20 lines
494 B
JavaScript

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({
key: fs.readFileSync(__dirname + '/server.key'),
cert: fs.readFileSync(__dirname + '/server.cert')
}, app).listen(9001, () => {
console.log('Listening...');
});