I've been building up simple react app which shows following crytowat.ch api. https://api.cryptowat.ch/markets
here is my code for redux-observable Epic
const cryptowatchEpic = action$ =>
action$.ofType(FETCH_PRICE).mergeMap(action =>
ajax({
url: `${baseUrl}${action.payload}/btcusd/price`,
crossDomain: true,
method: 'GET',
headers: {
'Access-Control-Request-Origin': 'https://api.cryptowat.ch/'
},
withCredentials: true
}).map(response => fetchPriceFilled(response))
);
and here is console error
XMLHttpRequest cannot load https://api.cryptowat.ch/markets/kraken/btcusd/price. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 405.
I think passed Access-Control-Request-Origin
in headers but i occurs error. is there something i missed?
thanks in advance