const proxy = {
	'/dev/': {
		target: 'http://127.0.0.1:8003',
		changeOrigin: true,
		rewrite: (path: string) => path.replace(/^\/dev/, '')
	},

	// 后端返回的报告链接等直接以 /open/ 开头，需要直接代理到后端
	'/open/': {
		target: 'http://127.0.0.1:8003',
		changeOrigin: true
	},

	'/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 };
