✨ feat(服务器): 修改服务器自动开服策略
This commit is contained in:
@@ -23,25 +23,6 @@ export default (appInfo: EggAppInfo) => {
|
||||
pw: ''
|
||||
};
|
||||
|
||||
let regions = [ // 大区数据
|
||||
{ id: 1, env: 'development', name: "测试", domain: 'http://127.0.0.1:9000' },
|
||||
];
|
||||
config.regions = regions;
|
||||
|
||||
let httpProxy: any = {};
|
||||
for(let { env, domain } of regions) {
|
||||
httpProxy[`/api/${env}/`] = {
|
||||
target: domain,
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
pathRewrite: function(path) {
|
||||
console.log('proxy', path, path.replace(`/api/${env}/`, '/api/'))
|
||||
return path.replace(`/api/${env}/`, '/api/')
|
||||
}
|
||||
}
|
||||
}
|
||||
config.proxy = httpProxy;
|
||||
|
||||
// the return config will combines to EggAppConfig
|
||||
return {
|
||||
...defaultConfig(appInfo),
|
||||
|
||||
Reference in New Issue
Block a user