0👍
The CORS mechanism is used to enforce the client requests are coming from applications belonging to the same domain as the domain at which the server is deployed by default.In other words, it is to ensure that our own applications are only applications that access our API and to prevent applications belonging to other domains to access it. In your case, the Client application and Server application are using different ports. That breaks the rule
The requests are initiated from application running at 8080 to the server API running at 80, though they are running in the same localhost.The port differs. That’s why the CORS errors are thrown.
Please set the header Access-Control-Allow-Origin
to localhost:8080
in the your PHP application to allow the cross domain requests.