Hi,
When i work in Localhost Im not getting Cors . When i host to cloud server im getting an Cors error.
I am using all headers proxy in react js.only local host is working .
Hi,
When i work in Localhost Im not getting Cors . When i host to cloud server im getting an Cors error.
I am using all headers proxy in react js.only local host is working .
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dinesh DRank #5,346 · 302 reputationPosted Aug 24, 2021, 7:45 AM EDT
Solution 1
Add cors to your backend server.js file in order to do cross-origin API Calls.
npm install -S cors
const cors = require('cors'); app.use(cors())Dinesh DRank #5,346 · 302 reputationPosted Aug 24, 2021, 7:46 AM EDT
Solution 2