I am building an app with Symfony2 and React. Currently I am trying to fetch data to the react frontend via AJAX calls. No matter what I decide later, I need to know how can I c
The Response of the server need to have the header Access-Control-Allow-Origin
(More info here).
As Example of a Symfony2 Controller Response with the value * (allowing any origin to access the resource.), you can build a Response as follow:
return new JsonResponse($data, 200, array('Access-Control-Allow-Origin'=> '*'));
Hope this help