Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

144
Vistas
Fetch JSON before static variables init

i'm working with some ENV value in JSON file. In my case, i want to fetch all env variables before app start and static variables init. I try to fetch it in index.html, but it still go after static variables. There is some way that i can do it ?

<script type="text/javascript">
  fetch('config/config.json')
    .then((res) => res.json())
    .then((data) => {
      console.log("config: ", data);
    })
    .catch((e) => {
      console.log(e)
    })
</script>

Thanks.

Ps: sorry about my english

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

well, I think you should create functions init() and start() put inside them the logic of initiation and starting the app, then call these functions from inside fetch().then().then(data=>{}).

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda