I am making an application with ReactJS and PHP in the backend. Now React is listening to port 3000 and PHP to port 80. So when a POST request is made, it shows it is a cross-origin request.
To handle this I tried "proxy" in react but that did not work. After this, I thought to change the config of apache server and add port 3000 as well. To do this I followed this link here but it did not work.
This is the error I get ... Job for apache2.service failed because the control process exited with error code.
...
And when I remove the changes, it works fine. Please help. I am stuck here for hours now.
UPDATE The suggested solution in the as proposed duplicate works when I use fetch() but does not work when I use Axios. Can not figure out the reason for this.