Skip to content

Instantly share code, notes, and snippets.

@ofanidariyan
Created April 3, 2017 18:30
Show Gist options
  • Save ofanidariyan/c446cc67ec60be50ec511e1299f1b6fa to your computer and use it in GitHub Desktop.
Save ofanidariyan/c446cc67ec60be50ec511e1299f1b6fa to your computer and use it in GitHub Desktop.
let https = require('https');
let fs = require('fs');
let options = {
key: fs.readFileSync('/opt/certs/example.com.key'),
cert: fs.readFileSync('/opt/certs/example.com.crt')
};
https.createServer(options, function (req, res) {
res.writeHead(200);
res.end("Welcome to Node.js HTTPS Server!!!");
}).listen(3443);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment