I'm developing a web app with React and want to distribute the client builded with the Electron framework. The user will have the possibility to change his server URL so I'd like give the possibility to modify a config file where to set the backend url to allow the client to listen to it.
Initially before using Electron I created a config.js file in my public folder like that:
config = {
"BACKEND_URL": "http://localhost:3000"
}
And then added a tag in my index.html to point to this script. In my React components I was using window.config.BACKEND_URL
to get the server URL.
Is there any practical solution to do something similar with a bundled Electron app? Thanks in advance