发布时间:2020-08-18编辑:佚名阅读(1535)
let express = require("express"); let http = require("http"); let https = require("https"); let fs = require("fs"); // Configuare https const httpsOption = { key : fs.readFileSync("./https/xxxxxxxxxxxx.key"), cert: fs.readFileSync("./https/xxxxxxxxxxxx.pem")} // Create service let app = express(); http.createServer(app).listen(80); https.createServer(httpsOption, app).listen(443);
关键字: Nodejs 配置 Https 服务 key crt pem
0人
0人
0人
0人