Some meteor packages need to know the absolute url of the running application. For example the accounts-google
or accounts-facebook
needs to know the url to correctly set the oauth redirect. If not set correctly (ie. to match the one configured in the social provider) the oauth flow fails.
If I run meteor the url is set to 127.0.0.1 by default. How can I change it?
I have found 2 solutions:
ROOT_URL
environment variableI think that the first solution is the more flexible. You can run your application using:
export ROOT_URL='http://yourcustomurl'
meteor
If using Cloud 9 you can create a run configuration where you can specify any environment variable, probably something like ROOT_URL='https://yourcustomurl.c9.io'
, and then run:
meteor --port $IP:$PORT