I migrated my angular 17 project to angular 18 and fount out that proxy.conf.json did not worked for me. What might be the problem here? Thank you in advance
"{
/api/*": {
"target": "http://127.0.0.1:8000",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
}
}```
2
Answers
for me it was this response that worked, adding the
pathRewrite
param :I share the config that I used updating Proxy with Bypass settings (before Angular 18) to Proxy using http-proxy-middleware (since Angular 18 https://angular.dev/tools/cli/serve#proxying-to-a-backend-server)
angular.json config
Before Upgrade (Angular < 18)
proxy.conf.js config :
After Upgrade (Angular 18)
proxy.conf.js config :
and you need to add http-proxy-middleware to devDependencies in package.json
launch your app with