收藏文章 楼主

Nodejs配置Https服务

版块:疑难   类型:普通   作者:小绿叶技术博客   查看:719   回复:0   获赞:0   时间:2021-11-14 05:38:10

# https://www.cnblogs.com/zzmiaow/p/10201035.html



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);

提供企业建站服务,免费网防系统,提交信息登录 http://yundun.ddoss.cn 邮箱: proposal@ddoss.cn 
回复列表
默认   热门   正序   倒序

回复:Nodejs配置Https服务

头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息