Hi
I am getting below error
Access to fetch at 'freeapi.miniprojectideas.com/api/BigBasket/GetAllProducts' from origin 'localhost:4204' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Thanks
Rajeesh MenothPosted Jun 26, 2024, 5:54 AM
Hi,
ss
The "changeOrigin" property is set to true to ensure that the origin header of the request is changed to match the target URL.
Once you have added the proxy.conf.json file to your project, you can start your development server by running ng serve. This should start a proxy server that will forward requests to your backend server and resolve the CORS issue.
Ramco RamcoPosted Jun 26, 2024, 5:28 AM
Hi
I have written below code but i am getting same problem
Thanks
Ramco RamcoPosted Jun 26, 2024, 5:09 AM
Hi Rajneesh
I was able to use this APi 'freeapi.miniprojectideas.com/api/BigBasket/GetAllProducts. Only today i am facing problem. What changes should i make in Angular 17 code
Thanks
Rajeesh MenothPosted Jun 26, 2024, 4:56 AM
Hi,
This article provides a clear explanation on how to resolve the CORS issue in Angular. You can refer to it for guidance.
https://medium.com/weekly-webtips/do-you-know-how-to-resolve-cors-issues-in-angular-9d818474825f