Update 'README.md'

fix #1
This commit is contained in:
snowdream 2019-01-09 14:39:11 +00:00
parent 84190bf6bf
commit 3775998627
1 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ var greenlock = require('greenlock-koa').create({
var http = require('http');
var https = require('https');
var koa = require('koa');
var app = koa();
var app = new koa();
app.use(function *() {
this.body = 'Hello World';
@ -84,7 +84,7 @@ server.listen(443, function () {
// http redirect to https
var http = require('http');
var redirectHttps = koa().use(require('koa-sslify')()).callback();
var redirectHttps = app.use(require('koa-sslify')()).callback();
http.createServer(greenlock.middleware(redirectHttps)).listen(80, function () {
console.log('Listening on port 80 to handle ACME http-01 challenge and redirect to https');
});