From 9f3e1221568a2bc95cea2d7de4c23b50ba8a8080 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 12 Dec 2015 15:38:14 +0000 Subject: [PATCH] noting API --- README.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ca3c305..5145079 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,39 @@ pushd letsencrypt Usage ===== +* `Letsencrypt.create(backend, bkDefaults);` + * { webrootPath, configDir, fullchainTpl, privkeyTpl } +* `le.middleware();` +* `le.sniCallback(hostname, function (err, tlsContext) {});` +* `le.register({ domains, email, agreeTos, ... })` returns promise + + + +```javascript +var leBinPath = '/home/user/.local/share/letsencrypt/bin/letsencrypt'; +var lep = require('letsencrypt-python').create(leBinPath); + +// backend-specific defaults +// Note: For legal reasons you should NOT set email or agreeTos as a default +var bkDefaults = { + webroot: true +, webrootPath: __dirname, '/acme-challenge' +, fullchainTpl: '/live/:hostname/fullchain.pem' +, privkeyTpl: '/live/:hostname/fullchain.pem' +, configDir: '/etc/letsencrypt' +, logsDir: '/var/log/letsencrypt' +, workDir: '/var/lib/letsencrypt' +, text: true +}; +var leConfig = { +, webrootPath: __dirname, '/acme-challenge' +, configDir: '/etc/letsencrypt' +}; +var le = require('letsencrypt').create(le, bkDefaults, leConfig); + + +``` + ```javascript var leBinPath = '/home/user/.local/share/letsencrypt/bin/letsencrypt'; var lep = require('letsencrypt-python').create(leBinPath); @@ -76,7 +109,7 @@ tlsServer.listen(443, function () { console.log('Listening http', server.address()); }); -le.register('certonly', { +le.register({ , domains: ['example.com'] , agreeTos: true , email: 'user@example.com'