Quantcast
Viewing all articles
Browse latest Browse all 4829

Networking and servers • Re: CORS assist

If you are using Apache2, add this to the .conf file

Code:

Header set Access-Control-Allow-Origin "*"
And enable the headers module, then restart Apache

Code:

 a2enmod headers
From a separate pi, we can then do a fetch in JavaScript to get JSON data from the Apache2 server that has CORS enabled.

Statistics: Posted by neilgl — Sun Nov 24, 2024 10:10 am



Viewing all articles
Browse latest Browse all 4829

Trending Articles