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

143
Views
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 answers
Answer question

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 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!