Skip to content

Instantly share code, notes, and snippets.

View Griha3212's full-sized avatar
🏠
Working from home

Griha3212

🏠
Working from home
  • Russia,Taganrog
View GitHub Profile
@deanrad
deanrad / cors.js
Last active April 9, 2021 09:26
Using CORS-Anywhere via AJAX
/*
If you are attempting to call an AJAX API, via GET which responds:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
You can modify the way you query it to go through a server which will add the header.
Basically, you add the URL you want (with query string parameters) at the end of
'https://cors-anywhere.herokuapp.com/'
, and ensure that your ajax call is done with some additional options as shown below
See CORS-Anywhere documentation here for more:
![Иллюстрация к проекту](https://github.com/jon/coolproject/raw/master/image/image.png)
![Image alt](https://github.com/{username}/{repository}/raw/{branch}/{path}/image.png)
{username} — ваш ник на ГитХабе;
{repository} — репозиторий где хранятся картинки;
{branch} — ветка репозитория;
{path} — путь к месту нахождения картинки.