oortcloud / unofficial-meteor-faq

The unofficial Meteor FAQ
953 stars 94 forks source link

added Deploy Q&A for sending static keys to clients #36

Closed BretFisher closed 3 years ago

tmeasday commented 11 years ago

Hey @BretFisher -- Thanks! This is a good one.

I think the more correct way is to pass the settings in through the METEOR_SETTINGS environment variable though. Something like

export METEOR_SETTINGS="$(cat /path/to/production-settings.json)"
node main.js

I haven't actually directly tested the above, but something like that should work.

[FYI @zol]

BretFisher commented 11 years ago

Still a bit confused about proper usage. So those of us running on our own servers and not meteor.com, we're likely running a shell or init.d script right? So METEOR_SETTINGS doesn't replace MONGO_URL, ROOT_URL, or MAIL_URL I assume? but can be used for all other custom app settings?

So if I'm correct, then my sh would still have exports for the standard Meteor environment vars, and a cat settings.json for anything custom?

tmeasday commented 11 years ago

Yes, you are correct. It's a little blurred, but my takeaway is that the settings.json is for application settings and the environment variables are for server settings. Thus when you deploy to meteor.com or run locally, you don't need to think about environment variables at all.

mitar commented 10 years ago

Yes. I think it is better to use settings.json than what is recommended in this pull request. Do not forget that if you want something to be available on the client, you have to put it under public key in settings.json.