Merge branch 'master' of snowdream/greenlock-koa.js into master

Thanks. Sorry I didn't see this sooner.
This commit is contained in:
AJ ONeal 2019-01-15 06:00:38 +00:00 committed by Gitea
commit f81c28a2f2
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 http = require('http');
var https = require('https'); var https = require('https');
var koa = require('koa'); var koa = require('koa');
var app = koa(); var app = new koa();
app.use(function *() { app.use(function *() {
this.body = 'Hello World'; this.body = 'Hello World';
@ -84,7 +84,7 @@ server.listen(443, function () {
// http redirect to https // http redirect to https
var http = require('http'); 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 () { http.createServer(greenlock.middleware(redirectHttps)).listen(80, function () {
console.log('Listening on port 80 to handle ACME http-01 challenge and redirect to https'); console.log('Listening on port 80 to handle ACME http-01 challenge and redirect to https');
}); });