Answer the question
In order to leave comments, you need to log in
How to forward data from API through Node.js to React app?
Hello! I'm building my own cryptocurrency tracker in React for practice. I need to use the CoinMarketCap API to get data about cryptocurrencies in order to use them in my application. The thing is, I can't get this data with a simple request to the right address, even using the CMC_PRO_API_KEY key from the client js, because Quote from API documentation:
Making HTTP requests on the client side with Javascript is currently prohibited through CORS configuration. This is to protect your API Key which should not be visible to users of your application so your API Key is not stolen. Secure your API Key by routing calls through your own backend service.
Answer the question
In order to leave comments, you need to log in
app.get('/api/v1/bitcoin', function (req, res) {
//запрос coinmarketcap
.then(response => res.json(response))
.catch(() => res.send("Ops something went wrong"))
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question