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

216
Views
¿Cómo alternar la URL del proxy en package.json según el indicador ixp? Reaccionar aplicación

#¿Cómo alternar la URL del proxy en package.json según el indicador ixp? Reaccionar aplicación... #

Me gustaría: el cambio de URL de proxy basado en un valor diferente de alguna variable dentro de la clase de servicio:

Tengo dos servidores proxy: - "https://tst.api1.com" y "https://tst.api2.com"

dentro del componente React tengo la función getSex() que devuelve hombre o mujer, si es hombre, me gustaría invocar api1 sino api2;

paquete.json:

 { "proxy": { "/abc": { "target": "https://tst.api1.com" // i need this to be toggeled based on getSex() value } } }

Componente de reacción:

 export async function getAllUsers() { const response = await fetch('/abc/users'); return await response.json(); }
about 4 years ago · Juan Pablo Isaza
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!