From d5c0475a01fdce31bdc927e47f805bd3eabef22f Mon Sep 17 00:00:00 2001 From: David Flanagan Date: Tue, 17 May 2016 14:22:21 -0700 Subject: [PATCH] clarify the approveRegistration() function in README.md --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 582117a..cfa2f32 100644 --- a/README.md +++ b/README.md @@ -42,15 +42,20 @@ npm install --save letsencrypt-express Using .testing() will overwrite the debug flag with true */ var LEX = require('letsencrypt-express').testing(); +// Change these two lines! +var DOMAIN = 'myservice.example.com'; +var EMAIL = 'user@example.com'; + var lex = LEX.create({ configDir: require('os').homedir() + '/letsencrypt/etc' -, approveRegistration: function (hostname, cb) { // leave `null` to disable automatic registration - // Note: this is the place to check your database to get the user associated with this domain - cb(null, { - domains: [hostname] - , email: 'CHANGE_ME' // user@example.com - , agreeTos: true - }); +, approveRegistration: function (hostname, approve) { // leave `null` to disable automatic registration + if (hostname === DOMAIN) { // Or check a database or list of allowed domains + approve(null, { + domains: [DOMAIN] + , email: EMAIL + , agreeTos: true + }); + } } }); ```