Check out example codes for "allow cross origin". It will help you in understanding the concepts better.

Code Example 1

Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: <origin>
Access-Control-Allow-Origin: null

Learn ReactJs, React Native from akashmittal.com