I am trying to create a headless drupal app. i am using drupal 8 as a beckend and react as a front-end. i have created REST services in drupal 8 using core rest services module. the problem is when i am calling the api its giving me error i.e
Fetch API cannot load http://192.168.1.246/headless-react/api/events. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 403. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I configured the services.yml file for cors.config but still getting error. can anyone have any idea how to solve it ? thanks