Configure Angular-cli proxy for custom headers in request to backend?

后端 未结 1 1487
滥情空心
滥情空心 2020-12-12 02:59

the topic, as I understand it is quite fresh and relevant. Tell me where is my mistake?

So, I did everything as in the documentation:

https://github.com/ang

相关标签:
1条回答
  • 2020-12-12 03:32

    Reposting the answer I posted in that other question.

    I had to make a small adjustment based on the above answers, although it seems a bit odd looking at the config now.

    This is my proxy.conf.json shown below:

    {
      "/api/*": {
        "target": "https://url.com",
        "secure": false,
        "changeOrigin": true,
        "logLevel": "debug",
        "pathRewrite": {"^/api" : "http://url.com/api"}
      }
    }
    

    Basically, I rewrote the path completely. And it works now.

    0 讨论(0)
提交回复
热议问题