Https Localhost11501 2021 -

// server.js (Node.js 14/16, circa 2021) const https = require('https'); const fs = require('fs'); const options = key: fs.readFileSync('localhost-key.pem'), cert: fs.readFileSync('localhost.pem') ;

).listen(11501, () => console.log('HTTPS server running at https://localhost:11501'); ); https localhost11501 2021

Generate self-signed certs with OpenSSL: // server

https.createServer(options, (req, res) => if (req.url === '/2021') res.writeHead(200, 'Content-Type': 'text/html' ); res.end('<h1>Welcome to the 2021 local project</h1>'); else res.writeHead(404); res.end(); // server.js (Node.js 14/16