Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4856

Networking and servers • Re: CORS assist

$
0
0
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 4856

Trending Articles