1const https = require("https"),
2 fs = require("fs");
3
4const options = {
5 key: fs.readFileSync("/srv/www/keys/my-site-key.pem"),
6 cert: fs.readFileSync("/srv/www/keys/chain.pem")
7};
8
9const app = express();
10
11app.use((req, res) => {
12 res.writeHead(200);
13 res.end("hello world\n");
14});
15
16app.listen(8000);
17
18https.createServer(options, app).listen(8080);
19