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