1.0.5 • Published 5 years ago
dn-middleware-https v1.0.5
dn-middleware-https
通过 https 中间件,可在本地为开发 server 启用 https 服务
使用方法
一、基本使用
dev:
- name: https
- name: server
https 中间件默契认将自动使用 server 中间件的 host
和 port
设定,默认情况下 server 中间件 host: localhost
,port:<auto>
,也可显式的指定对应配置
dev:
- name: https
- name: server
host: local.abc.com
port: 9443
二、声明本地域名
当然,也可在 https 中间上声明 host
和 port
信息
- name: https
host: local.abc.com
port: 9443
- name: server
小提示
一般情况下 port
无需设定,会自动选取一个可用端口,但使用了 https 中间件后,建议设定一下 host
,以避免因证书不匹配提示「非安全链接」
域名通常需要同时添加到本机的 hosts
中,示例
127.0.0.1 local.abc.com