12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- const env = require('../parseEnv');
- let apiRootPath = env._SETTING_API_BASE_PATH.replace(/"/g, '') || '';
- const proxySetting = {
- [`/${apiRootPath}/labeling`]: {
- target: env._SETTING_SERVER_PROXY_PROJECT.replace(/"/g, ''),
- changeOrigin: true,
- secure: false,
- ...(env._SETTING_SERVER_PROXY !== env._SETTING_SERVER_PROXY_PROJECT && {
- pathRewrite: {
- [`^/${apiRootPath}/labeling/`]: '/',
- },
- }),
- },
- [`/${apiRootPath}/bc`]: {
- target: env._SETTING_SERVER_PROXY_BC.replace(/"/g, ''),
- changeOrigin: true,
- ...(env._SETTING_SERVER_PROXY !== env._SETTING_SERVER_PROXY_BC && {
- pathRewrite: {
- [`^/${apiRootPath}/bc/`]: '/',
- },
- }),
- },
- [`/${apiRootPath}/uc`]: {
- target: env._SETTING_SERVER_PROXY_UC.replace(/"/g, ''),
- changeOrigin: true,
- ...(env._SETTING_SERVER_PROXY !== env._SETTING_SERVER_PROXY_UC && {
- pathRewrite: {
- [`^/${apiRootPath}/uc/`]: '/',
- },
- }),
- },
- [`/${apiRootPath}/traintask`]: {
- target: env._SETTING_SERVER_PROXY_TRAIN_TASK.replace(/"/g, ''),
- changeOrigin: true,
- pathRewrite: {
- [`^/${apiRootPath}/traintask/`]: '/',
- },
- },
- };
- module.exports = {
- proxySetting,
- };
|