From 1e2bf80b5dfb0653989195a742bdac357af71dc3 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 9 Aug 2016 18:56:46 -0600 Subject: [PATCH] fix non-promise example --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fd1a6ce..afc0fba 100644 --- a/README.md +++ b/README.md @@ -61,12 +61,11 @@ of how to use this library: ```javascript var le = require('letsencrypt').create({ server: 'staging' }); -le.register( - { domains: ['example.com'], email: 'user@email.com', agreeTos: true } -, function (err, results) { - console.log(err, results); - } -); +le.register({ domains: ['example.com'], email: 'user@email.com', agreeTos: true }).then(function (results) { + console.log(results); +}, function (err) { + console.error(err); +}); ``` You also need some sort of server to handle the acme challenge: