m-ahmadi / tse-client

A client for fetching stock data from the Tehran Stock Exchange (TSETMC). Works in Browser, Node and as CLI.
MIT License
33 stars 12 forks source link

CORS error #3

Closed AhmadPirzargar closed 3 years ago

AhmadPirzargar commented 3 years ago

Hi, When running each browser test I get a CORS error. Screenshot from 2021-08-14 15-13-57

Thank you for any help.

m-ahmadi commented 3 years ago

Hi,

You either have to install a Chrome or Firefox extension and enable CORS requests. (which is what I do most of the time)

or you have to set up a proxy server on your machine and set tse.API_URL to point to that server. for example look at this simple php proxy

m-ahmadi commented 3 years ago

One extra note: You should serve these files through a web server, and not opened like file:///tse-client/test/browser/basic.htm, but rather like http://localhost/tse-client/test/browser/basic.htm.