将动态变量传递给proxy.config.json

时间:2020-10-12 16:57:54

标签: angular

我正在尝试使用proxy.config.json通过角度CLI代理路由API调用。我想通过代理路由到以下网址

url: http://dom.com/test/{123}/sample

代理网址: http://loclahost:8080/api/{123}

到目前为止,我在代理配置中拥有什么

proxy.config.json:

    "/api/*": {
      "target": "http://dom.com/test/{id}/sample",
      "secure": false,
      "changeOrigin": true,
      "logLevel": "debug",
      "pathRewrite": {
        "^/api": ""
      }
    }

如何将动态值传递给url?

0 个答案:

没有答案