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
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=>{}).