I am new in react
gatsby
, when i do api call it gives me error origin has been blocked by CORS policy
, here i have placed my whole code, can anyone please look into it, and help me to resolve this issue.
API CALL
get_review_list() {
fetch('http://******/get-dashboard-reviews/1', {
method: 'POST',
mode: "cors",
headers: {
'Accept': 'application/json',
'Access-Control-Allow-Origin': '*',
}
}).then(function (response) {
alert('sdsdsdds'); console.log('123');
//const data = response.json(); console.log(data);
})
.catch(function (error) { console.log(error) });
}
In gatsby-config.js
proxy: {
url: "http://********",
},