Angular-CLI proxy to backend doesn't work

后端 未结 9 1100
不知归路
不知归路 2020-11-28 08:00

https://github.com/angular/angular-cli#proxy-to-backend here is an instruction how to do proxying to backend. I did everything step by step and still requests aren\'t proxie

9条回答
  •  情歌与酒
    2020-11-28 08:33

    Proxy attribute pathRewrite should be added in the proxy.conf.json. See the example below. { "/services/*": { "target": "http://yoururl.com", "secure": false, "changeOrigin" : true, "pathRewrite": { "^/services" : "" } } }

    and run ng serve --proxy-config proxy.conf.json Surely it will work.

提交回复
热议问题