donaldaverill / meteor-package-settings

Simple settings management for Meteor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Settings for Meteor Build Status

Simple settings management for Meteor. Define fields and require Meteor.settings to be set with either METEOR_SETTINGS environment variable or by passing a JSON file with the --settings option when starting Meteor.

Install

meteor add fourquet:settings

Usage

On the server, define Settings.appSettingsObj as an object to match Meteor.settings against. A Meteor.Error will be thrown if the settings do not match and program will exit. See the Check documentation for more details on matching.

On the server (not in Meteor.startup):

Settings.appSettingsObj = {
  public: Match.ObjectIncluding({
    siteName: String,
  }),
  emailDomain: String,
  kadira: {
    appId: String,
    appSecret: String,
  },
  google: {
    clientId: String,
    secret: String,
    loginStyle: String,
  },
};

Matching settings.json

{
  "public": {
    "siteName": "Settings Example"
  },
  "emailDomain": "example.com",
  "kadira": {
    "appId": "appId",
    "appSecret": "appSecret"
  },
  "google": {
    "clientId": "clientId",
    "secret": "secret",
    "loginStyle": "popup"
  }
}

Version

0.0.2

License

MIT

About

Simple settings management for Meteor

License:MIT License


Languages

Language:JavaScript 93.4%Language:HTML 5.5%Language:CSS 1.1%