Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor client side settings

Tags:

meteor

Is there a good way to store client side settings for meteor that would be load before any other javascript?

I would put things like api ids and other such into it.

like image 762
Harry Avatar asked Mar 21 '13 22:03

Harry


1 Answers

If you're not doing any kind of initialization, i.e just storing values such as your api keys you can:

1) Have a settings.json file containing your settings in your project dir e.g

{ 
   "public" : {
       "api_key":"value1"
   }
}

Then start meteor with this settings file

meteor --settings settings.json

Access this value on your client via:

Meteor.settings.public.api_key
=> "value1"
like image 98
Tarang Avatar answered Sep 20 '22 04:09

Tarang