Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
In React Js Axios request getting CROS error

I used Axios for API, here is my code. I am getting CROS error.

axios({
      method: 'GET',
      headers : { 'Content-Type': 'application/json',
                  'Access-Control-Allow-Origin' : '*',
                  'mode': 'cors',
                  'Authorization':'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1N....'
                },
      url: baseURL,          
    }).then(function (response) {
          console.log(response);
    });

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You'll need to enable CORS from your back-end service. From the image, it is clear that your front-end in running on localhost on port 3000 whereas your back-end or api service is running on port 8000 on localhost. So, enable CORS from your back-end or api serivce.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!