Lets Encrypt certificate manager
javascript
// create and manage certificate for a domain
const https = require('https');
const CertificateManager = require('lets-encrypt-certificate-manager');
CertificateManager.domain = 'www.example.com';
CertificateManager.email = 'admin@example.com';
CertificateManager.httpToHttpsRedirectEnabled = true; // redirects all traffic from http to https
CertificateManager.ip = '12.123.123.21';
//CertificateManager.version = 'draft-12'; // default is 'draft-12'
//CertificateManager.isProduction = true; // default is true
//CertificateManager.renewCertWithin = 60 24 60 60 1000; // default is 60 24 60 60 1000
//CertificateManager.renewCertBy = 30 24 60 60 1000; // default is 30 24 60 60 1000
//CertificateManager.debugEnabled = true; // default is true
var greenlock = CertificateManager.greenlockInit();
https.createServer(greenlock.httpsOptions, (req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);
``