I am creating an angular application which involves working with API. I have created an API on my localhost and tried to request on it with AJAX. But it shows me the CORS error. I tried everything to solve this but nothing worked even from the stackoverflow. It shows me error like
Access to XMLHttpRequest at 'localhost/graphql' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
How can I do this?