Anubhav Dhawan
Anubhav Dhawan

Reputation: 1487

meteor build --server vs ROOT_URL

What is the difference between the server urls provided via meteor build while deploying the meteor app vs the root url provided via ROOT_URL environment variable provided during running the meteor server.

ie:

meteor build --server http://foo.com

vs

export ROOT_URL=http://foo.com

Upvotes: 1

Views: 853

Answers (1)

Mikkel
Mikkel

Reputation: 7777

The build time --server parameter is of use for android/ios devices - this tells the apk/app where it's Meteor server is. On a web page it's easier, because all url's are relative to the current URL.

The HTML/CSS/JS is all bundled into the apk/app, and is resident on the device. The hot code push mechanism needs to know the address of the server to contact for updates.

The environment variable is for the benefit of the server, so that it knows what it's own location is. It can't rely on its own IP address, because it's probably behind a firewall anyway, and even the IP address is of no use in a shared hosting environment, it needs to know the URL.

Upvotes: 3

Related Questions