The easy fix to allow your Web App to read remote json files from the server is to create the .htaccess file.
Create an `.htaccess` file and place it in the directory of the json files.
Header set Access-Control-Allow-Origin "*"
Simply reload your app and it should work! good luck!
Every time Apple releases a major OS it seems to break my web development, so I switched my setup to use Brew which made things even more confusing –at first.
The folder locations might be a little different for you, but the point is: I was editing the wrong file and seeing no results.
Here are a few things to keep in mind when debugging your system issues:
1. There are two instances of Apache if you used brew (one from Apple, and one from Brew), and each is started differently
sudo brew services restart httpd
sudo apachectl -k restart
2. This also means I was looking at wrong httpd.conf files, there are multiple ones:
3. I also have different installation of php libraries now that I switched to Brew
brew install firstname.lastname@example.org)
Apple overwrites your
httpd.conf file when upgrading the system, but it saves an old version, you just have to rename it.
Great instructions how to setup Apache on Mac using Brew ->
Setup Apache on Mac
Another good article how to Setup apache and php on macOS Mojave -> Apache on Mojave with multiple versions