Skip to content

Instantly share code, notes, and snippets.

@michaeljymsgutierrez
Last active March 31, 2018 13:49
Show Gist options
  • Select an option

  • Save michaeljymsgutierrez/c166622cfd8cb785045dbd2c69191e83 to your computer and use it in GitHub Desktop.

Select an option

Save michaeljymsgutierrez/c166622cfd8cb785045dbd2c69191e83 to your computer and use it in GitHub Desktop.
Express to Https
Exec in terminal
sudo certbot --authenticator webroot --webroot-path <path-to-webroot> --installer apache -d <your-domain>
sudo certbot certonly --webroot --webroot-path= <path-to-webroot> -d <your-domain>
var https = require('https');
var sslOptions = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem'),
};
https.createServer(sslOptions, app).listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment