Boa tarde, tentei comunicar o react com uma api q tem na minha maquina, quando chamo api no navegador ela responde normalmente, mas quando chamo via react tenho a seguinte mensagem
Failed to load http://localhost:8080/teste/Autores/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 403.
componentWillMount(){
$.ajax({
url:"http://localhost:8080/teste/Autores/",
crossDomain: true,
type: "GET",
headers: {"X-API-KEY": "_KEY_"},
dataType: 'json',
success:function(resposta){
console.log(resposta);
this.setState({lista:resposta});
}
}
);
}