Making your web server support CORS is as simple as making it return a different header.
For example, in Apache2, just add this line to the corresponding conf file:
Header set Access-Control-Allow-Origin "*"
To be more secure (or if you donโt have access to your serverโs conf conf file), you can NOT add this header to your server, but only add it using server-side code when you really want to.
For example, in PHP you can do this: (untested)
<? header('Access-Control-Allow-Origin "*"'); ?>
Magmatic
source share