(continuation of error message in title) \" Origin \'http://127.0.0.1:4200\' is therefore not allowed access.\"
I am unable to run the same Angular 5 site on two dif
Let's assume your api runs on 8080 and your angular code on 4200.
In your angular app create a file called proxy.conf.json
{
"/api/": {
"target": "http://localhost:8080/",
"secure": false,
"changeOrigin": true
}
}
Start angular app using this command
ng serve --port 4200 --proxy-config proxy.conf.json
With this configuration when you call localhost:4200/api you it will call 8080 and it won't have any CORS error