Brunno Vodola Martins
Brunno Vodola Martins

Reputation: 1692

Meteor app runnning on localhost (hosted on MacBook) does not work from other devices

I have a Meteor app running on my MacBook with OSX 10.11.5 (El Capitain)

I'm trying to test my Meteor app on different devices connected to the same Wireless Network as the Mac. For that I ran ifconfig and took note of the Mac's ip (192.168.2.109). When I go to 192.168.2.109:3000 on the Mac, it works. However, it does not work in any other device.

There's also another important point: I ran the very same project from on another machine (using Ubuntu 14.04) and everything went fine. I was able to access the app from all the devices connected to the network.

Moving on, I also tried to run the app like this too (but didn't work): meteor --port=http://192.168.2.109:3000 --mobile-server=http://192.168.2.109

I checked the OSX Firewall and it's disabled.

I tried to follow the anwsers from these questions:

But none of them worked.

Has anyone experienced this before? Some guidance would be appreciated! Thanks.

Upvotes: 1

Views: 193

Answers (1)

bearcanrun
bearcanrun

Reputation: 56

You have to set the environment variable ROOT_URL. So in your case, CLI input should be: ROOT_URL="http://192.168.2.109" meteor --port 3000

If you are just using the default port of 3000, you don't need the --port 3000, I showed it in case you wanted to use a different port.

You can read more about environment variables here: Meteorpedia: Environment Variables It should be noted that this is an older resource not up to date with all the latest specifications. However, my search of the Meteor Guide didn't reveal the specific answer to your question.

Upvotes: 2

Related Questions