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