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

228
Views
'http://localhost:3000' ha sido bloqueado por la política CORS - Para API externa

No tengo acceso a una API externa, pero CORS me bloquea. También he habilitado "Access-Control-Allow-Origin" en la configuración de publicación de Axios. La mayoría de las respuestas están adaptadas a una API local. ¿Cómo soluciono esto?

 const auth = { username: "xxx", password: "xxx", }; const res = await axios.get( `https://api.staging.CORP.dev/stuff/{my-key}/pub_id`, { auth }, { headers: { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*", }, } ); const pub = res.data.map((pub) => ({ puv_id: pub.id })); const data = { address: { postcode: 'PostCode', }, full_name: 'name', email: 'email', pub_id: pub }; axios .post( "https://api.staging.CORP.dev/stuff/{public}/orders", data, { auth }, { headers: { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*", }, } ) .then((res) => console.log(res)) .catch((err) => console.log(err.response));
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede intentar agregar "proxy": "http://localhost:3000", en su paquete.json

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!