You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
986 B

module.exports = {
devServer: {
proxy: {
'/api': { // 你的目标服务器的请求路径前缀
target: 'https://hwjb.homilychart.com', // 目标服务器的地址
changeOrigin: true, // 是否跨域
secure: false, // 如果是https接口,需要配置这个参数
pathRewrite: {
'^/api': '' // 将 /api 替换为 /testApi,以便正确请求目标服务器的资源
}
}
}
// proxy: {
// '/api': { // 你的目标服务器的请求路径前缀
// target: 'http://192.168.40.8:9000', // 目标服务器的地址
// changeOrigin: true, // 是否跨域
// secure: false, // 如果是https接口,需要配置这个参数
// pathRewrite: {
// '^/api': '' // 将 /api 替换为 /testApi,以便正确请求目标服务器的资源
// }
// }
// }
}
}