wangzhibo
6 天以前 da0230346106bc810664488a2b152bc24f853a44
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const proxy = {
    '/dev/': {
        target: 'http://127.0.0.1:8001',
        changeOrigin: true,
        rewrite: (path: string) => path.replace(/^\/dev/, '')
    },
 
    '/prod/': {
        target: 'https://show.cool-admin.com',
        changeOrigin: true,
        rewrite: (path: string) => path.replace(/^\/prod/, '/api')
    }
};
 
const value = 'dev';
const host = proxy[`/${value}/`]?.target;
 
export { proxy, host, value };