0
我需要设置AngularCLI/ENV的WebPack内的代理从http://localhost:4200/rest
请求转发到https://someserver.com/somepath/rest
的WebPack /角CLI /代理转发
其一,终端是HTTPS而不是HTTP。
其次,请求URL可以是http://localhost:4200/rest/foo
或...:4200/rest/bar
,所有和任何后“/休息”未来的路径需要被映射到https://someserver.com/somepath/rest/foo
或...com/somepath/rest/bar
以下proxy.conf.json似乎并不正确配置:
"/rest": {
"target": "https://someserver.com",
"changeOrigin": true,
"ws": true,
"pathRewrite": {
"^/rest/": "/somepath/rest/"
},
"secure": false,
"logLevel": "debug"
}
应用程序是开始
ng serve --proxy-config proxy.conf.json --live-reload --host 0.0.0.0
谢谢!
这工作。谢谢。 – pop