webpack配置域名

This commit is contained in:
hackrobot
2024-07-17 13:42:36 +08:00
parent c0df39db6a
commit 621b54d83e
3 changed files with 70 additions and 10 deletions

View File

@@ -74,15 +74,21 @@ const config = {
// HOST: '"/api"'
// },
devServer: {
// host: 'nomad.hackrobot.cn', // 替换为您的域名
// port: 10086, // 选择一个适当的端口号
proxy: {
'/api/': {
target: JSON.parse('"http://localhost:8055"'), //本地调试端口
target: JSON.parse('"http://localhost:8700"'), //本地调试端口
pathRewrite: {
'^/api/': '/'
},
changeOrigin: true
}
}
},
// 允许特定域名访问
allowedHosts: [
'nomad.hackrobot.cn'
],
}
},
};