关于使用koa实现线上 https服务
作者:互联网
var https=require(“https”);//https服务
var fs= require(“fs”);
var Koa = require(‘koa’);
var enforceHttps = require(‘koa-sslify’).default;
var app = new Koa();
app.use(enforceHttps());
var options = {
key: fs.readFileSync(’./2_xxx.key’),
cert: fs.readFileSync(’./1_xxx_bundle.crt’)
}
https.createServer(options, app.callback()).listen(5300);
console.log(‘服务器运行中’)
更多内容请见原文,原文转载自:https://blog.csdn.net/weixin_44519496/article/details/119816354
标签:fs,koa,require,线上,https,var,app 来源: https://www.cnblogs.com/wangchuanxinshi/p/16352908.html