记一下nodejs升级https的操作
将下载好的证书放置在项目目录下
let https = require("https"); let fs = require("fs"); const httpsOption = { key: fs.readFileSync("./[证书目录]/xxx.key"), cert: fs.readFileSync("./[证书目录]/xxx.pem") } https.createServer(httpsOption, app).listen(18889);
示例地址:https://tiaocaoer.com:18889/rr?page=1
本文分享自 作者个人站点/博客 前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体分享计划 ,欢迎热爱写作的你一起参与!