uniapp h5本地调试设置多个代理

"devServer" : {
            "https" : false,
            "port" : 8080, //浏览器运行端口
            "disableHostCheck" : true,
            "proxy" : {
                "/api1/" : {
                    "target" : "http://www.bai.com/api1/", //实际请求服务器地址
                    "changeOrigin" : true,
                    "secure" : true,
                    "pathRewrite" : {
                        "^/api1/" : ""
                    }
                },
                "/api2/" : {
                    "target" : "http://www.bai.com/api2/", //实际请求服务器地址
                    "changeOrigin" : true,
                    "secure" : true,
                    "pathRewrite" : {
                        "^/api2/" : ""
                    }
                }
            }
        },

猜你喜欢

转载自blog.csdn.net/qq_35086913/article/details/120847341