'Combine PHP backend into one file for Axios GET React [closed]
I am using React frontend and connect it to PHP with Axios to get data via cURL. Currently I have few Axios gets in React and few files. Can I combine the PHP files into one file and separate them inside the same file and use React to get the data separately?
This is my frontend or react code
My backend which is similar to the other php files but different api.
I would like to combine the cURL's into one file and separate them maybe via functions or something that can be used by Axios to be called separately. Is it possible?
Solution 1:[1]
Found the solution by using (isset($_GET['memory'])) in the php file and axios.post('http://localhost/react-backend/index2.php?memory') in react frontend
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Maghesan |
