parent
84190bf6bf
commit
3775998627
|
@ -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');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue