首页 > Web开发 > 详细

Vue-CLI为前端项目配置https证书

时间:2020-11-09 18:05:59      阅读:402      评论:0      收藏:0      [点我收藏+]

直入正题,直接在Vue-CLI的vue.config.js文件devServer字段配置:

    // 证书的密码
    pfxPassphrase: ‘xxxx‘, // when develop with https need to provide server certificate to browser.
    // 证书在本项目下的相对路径
    pfx: ‘./x/xx.pfx‘, // https://github.com/gitpod-io/gitpod/issues/26
    // win10 host文件中 对本机IP映射的域名,例如本机IP 192.168.0.22, host文件对该IP的映射域名为 xxx.com
    public: ‘xxx.com‘ // https://stackoverflow.com/questions/43619644/i-am-getting-an-invalid-host-header-message-when-connecting-to-webpack-dev-ser

Vue-CLI为前端项目配置https证书

原文:https://www.cnblogs.com/suiucat/p/13949066.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!