Angular - Proxy settings to avoid CORS

less than 1 minute read

Create a proxy.config.json

1
2
3
4
5
6
{
  "/api": {
    "target": "http://localhost:8080",
    "secure": false
  }
}

run ng serve with a configuration file.

1
ng serve --proxy-config proxy.config.json