На React делаю запрос к VK API через axios. Запрос делаю на localhost.
componentDidMount() {
axios.get('https://api.vk.com/method/groups.getById?gid=27541941&fields=members_count')
.then(res => {
const lol = res.data;
console.log(lol);
});
}
И в консоли возваращет еррор:
MLHttpRequest cannot load https://api.vk.com/method/groups.getById?gid=39094469&fields=members_count. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://smns.loc' is therefore not allowed access.
Как пофиксить?