I'm trying to do a get call with axios from my react application. But I keep getting the following error
Access to XMLHttpRequest at 'http://localhost:8080/api/v1/company/getmycompany?uid=1' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
When I do the same call in postman with the same parameters it returns the information with no issue. But I just can't find what is wrong with my code, below my code
const res = await axios.get('http://localhost:8080/api/v1/company/getmycompany?uid=1', {
headers: {
'Authorization': 'Bearer '+ JWTToken
}
});
Does anybody know what I'm doing wrong with this?