var express = require('express');
var https = require('https');
var http = require('http');
const fs = require('fs');
const options = {
key: fs.readFileSync('path/yourdomain.com.key'), //key 私钥 路径
cert: fs.readFileSync('path/yourdomain.com.crt') // cert 域名证书+根证书 路径
};
var app = express();
http.createServer(app).listen(80);
https.createServer(options, app).listen(443);
网友评论