I'm learning how to use Framework React. In the submitting part of form data, and retrieving this data, I am using ajax with the jQuery function.
componentDidMount() {
$.ajax({
url:"http://localhost:80/contatos/dados-json.php",
dataType:'json',
success:function(clientes){
this.setState({lista:clientes});
}.bind(this)
});
}
But this URL to whom I am requesting is from another server that is local to my machine (a Xampp server).
Translating, there are two Local Servers on the same machine
If you look like this:
The problem with this is that I get cross-server requests, and it ends up giving me more problems to work.
I would like to know how to put PHP and BD files on the same React server?