I’m currently need to send HTTP requests API to various server. The address is saved in settings.json as this guide
However, the server keeps restart when I change the settings.json. How to avoid this? I already tried .meteorignore, but it doesn’t work.
A Meteor server, like any Node server, starts once and then runs forever (assuming no crashes). That means the only time the
settings.json file is read is at start-up. After then, it’s never looked at again.
If you run Meteor in development mode (using the
meteor command), Meteor will restart if it sees a change in the
settings.json file, so it can reload the new values. However, you should not run
meteor in production!
The short version is you cannot use
settings.json for dynamically changing values, so you need to find the correct way to do what you want to do. If you can explain what you’re trying to do, perhaps we can help.
Hi, I put in settings.json a few connection parameter like API url, timeout in milisecond and so on… Due to the API in testing phase, those paramaters changes alot. Are there any workaround to avoid server reload?
The easiest way is to put them into MongoDB.
Thank you for the quick reply. I really appreciate that