This worked for me on a Pi5-8GB getting JSON data from a Pi5-4GB running Apache2The Pi5 Apache server (192.168.1.151) 000-default.conf was simple:
Code:
pi@pi5-8GB:/var/www/html $ curl -L http://192.168.1.151/shared/data.json{ "id": "sensor1", "value": 12.34}
Code:
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # allow cross origin Header set Access-Control-Allow-Origin '*'</VirtualHost>
Statistics: Posted by neilgl — Tue Nov 26, 2024 10:28 am