嗨,我想使用env变量在代理conf中进行设置。有可能吗?
我的命令
npm start --APP_TARGET_URL=url_app --PROMETHEUS_URL=url_prom
我的代理配置文件
{
"/website": {
"target": "${process.env.APP_TARGET_URL}/home",
"secure": false,
"changeOrigin": true,
"logLevel": "info",
"pathRewrite": {
"^/website": ""
}
},
"/prometheus": {
"target": "${process.env.PROMETHEUS_URL}",
"secure": false,
"changeOrigin": true,
"logLevel": "info",
"pathRewrite": {
"^/prometheus": ""
}
}