Skip to content

Instantly share code, notes, and snippets.

@Prosen-Ghosh
Created January 22, 2023 16:06
Show Gist options
  • Save Prosen-Ghosh/db30f3a470510a6df5dd5375539d11b3 to your computer and use it in GitHub Desktop.
Save Prosen-Ghosh/db30f3a470510a6df5dd5375539d11b3 to your computer and use it in GitHub Desktop.
const https = require('https');
const fs = require('fs');
const options = {
key: fs.readFileSync('path/to/private.key'),
cert: fs.readFileSync('path/to/certificate.crt')
};
https.createServer(options, (req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment