Fast solution:
Create startup.sh and insert:
export MONGO_URL='mongodb://login@db'
meteor
sh startup.sh
Vra
I am using Ubuntu 13.10 lokal and running my meteorJs app on it. My MongoDB is an external DB (modulus.io).
I set my mongoDb in my console like this:
sudo MONGO_URL='mongodb://login@db' meteor
Works fine.
But everytime when I restart my lokal meteorJs App this settings seems to be resetet! So everytime when I restart my App I have to set the enviroment variable again and again ...
Is there a way to set this variable permanent in my meteorJs App so I dont have to re set it again and again.
Oplossing
Fast solution:
Create startup.sh and insert:
export MONGO_URL='mongodb://login@db'
meteor
sh startup.sh
Ander wenke
Another way to set environment variables that are accessed from within your app, is to put the following in your server code, i.e. for HTTP_FORWARDED_COUNT
:
process.env.HTTP_FORWARDED_COUNT = 1
Doing it programmatically like this does not work for variables that need to be read during the app startup process, however - such as the MongoDB URL.