"start": "meteor run --port 111.111.1.111:3000 --settings settings-local.json",
I like using the IP instead of localhost, then I can connect my iphone and debug webapps by mobile, or I can have my expo react-native app hit the local version of the server code.
But every time I switch locations (home/office) I have to remember to go in my script and change out the hard coded address (it changes depending on whos wifi you’re on). Is there a variable or something that I can plug into my start script so it just grabs whatever the IP is?
It’s not the end of the world but it’s one of those things where you’re like “there has to be a better way”
I know you can get the IP in the code, but I need it in the start script.
I know this is a pretty old thread, but I have the exact same problem (on a Mac). Does anyone know a solution for this?
I am developing at multiple locations, but need to provide Meteor with a real IP (localhost won’t work). Every time I switch my environment, I have to patch package.json again to set the correct IP.
You could use a dynamic DNS service. Since I have my own domain names with namecheap, I use their service, for which they don’t charge anything. Also with them, you can use your browser to set your domain (or just a host thereof) to your currently assigned IP address dynamically.
Thanks. Yes, this can be done via shell scripting, but I would prefer a solution that works across operating systems, in our case Windows and Mac. Couldn’t find a “npm only” solution so far, though.
In our case, the dev instance running on my mac is reachable from the outside as peter.mydomain.com, my colleague’s as tom.mydomain.com and so on; so it’s a team solution (almost) without additional configuration. The only thing each of us had to set once is an env var with that name in .bash_profile.