I'm building a website in Angular 4.
My url server side (Web Api) was http://localhost:55499/api
My url client side is http://localhost:4200.
And it worked well.
For various reasons I changed the url server to http://localhost/AAA/api/ and I start to use iis express instead local iis.
And since then it has stopped working.
Brings the following error:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
The response had HTTP status code 400.
I have in my response Access-Control-Allow-Origin:http://localhost:4200
I have in the controller:
[EnableCors(origins: "http://localhost:4200", headers: " * ", methods: " * ")]
I use IIS EXPRESS.