better organization
This commit is contained in:
parent
67e0885675
commit
992a684a28
19
README.md
19
README.md
|
@ -164,7 +164,17 @@ var greenlock = require('greenlock').create({
|
||||||
, agreeTos: true // Accept Let's Encrypt v2 Agreement
|
, agreeTos: true // Accept Let's Encrypt v2 Agreement
|
||||||
, communityMember: true // Optionally get important greenlock updates (security, api changes, etc)
|
, communityMember: true // Optionally get important greenlock updates (security, api changes, etc)
|
||||||
|
|
||||||
, approveDomains: function (opts, certs, cb) {
|
, approveDomains: approveDomains
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
/////////////////////
|
||||||
|
// APPROVE DOMAINS //
|
||||||
|
/////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
function approveDomains(opts, certs, cb) {
|
||||||
|
|
||||||
// check for domains you want to receive certificates for
|
// check for domains you want to receive certificates for
|
||||||
if ('example.com' === opts.domain) {
|
if ('example.com' === opts.domain) {
|
||||||
|
@ -174,9 +184,10 @@ var greenlock = require('greenlock').create({
|
||||||
|
|
||||||
// return error otherwise
|
// return error otherwise
|
||||||
cb(new Error("bad domain"));
|
cb(new Error("bad domain"));
|
||||||
}
|
}
|
||||||
});
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
////////////////////
|
////////////////////
|
||||||
// CREATE SERVERS //
|
// CREATE SERVERS //
|
||||||
////////////////////
|
////////////////////
|
||||||
|
@ -184,7 +195,7 @@ var greenlock = require('greenlock').create({
|
||||||
var redir = require('redirect-https')();
|
var redir = require('redirect-https')();
|
||||||
require('http').createServer(greenlock.middleware(redir)).listen(80);
|
require('http').createServer(greenlock.middleware(redir)).listen(80);
|
||||||
|
|
||||||
require('https').createServer(greenlock.tlsOptions, function (req, res) {
|
require('spdy').createServer(greenlock.tlsOptions, function (req, res) {
|
||||||
res.end('Hello, Secure World!');
|
res.end('Hello, Secure World!');
|
||||||
}).listen(443);
|
}).listen(443);
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue