首页 > 其他 > 详细

vue多个代理配置vue.config

时间:2020-11-26 22:30:17      阅读:109      评论:0      收藏:0      [点我收藏+]

vue多个代理配置

vue.config

    devServer: {
        host: ‘localhost‘,
        port: 8200,
        proxy: {
            ‘/api‘: {
                target: ‘http://192.168.0.8:80‘, 
                changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
                ws: true,
                pathRewrite: {
                    ‘^/api‘: ‘/‘
                }
            },
            ‘/noAuthorization‘: {
                target: ‘http://192.168.0.8:8202‘,
                changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
                ws: true,
                pathRewrite: {
                    ‘^/noAuthorization‘: ‘/‘
                }
            }
        }
    }

 

vue多个代理配置vue.config

原文:https://www.cnblogs.com/zlp520/p/14044047.html

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