Question

How to configure proxy with Angular 18

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"
  }
}```
 3  40  3
1 Jan 1970

Solution

 0

for me it was this response that worked, adding the pathRewrite param :

{
    /api/*": {
    "target": "http://127.0.0.1:8000",
    "secure": false,
    "changeOrigin": true,
    "logLevel": "debug"
    "pathRewrite": {
      "^/api": ""    
    }
  }
}
2024-07-25
Kvn91