Skip to content

Instantly share code, notes, and snippets.

@kylemclaren
Forked from ritikm/1_settings.js
Last active August 29, 2015 14:07
Show Gist options
  • Save kylemclaren/06124f55713a6739ea01 to your computer and use it in GitHub Desktop.
Save kylemclaren/06124f55713a6739ea01 to your computer and use it in GitHub Desktop.
environment = process.env.NODE_ENV || "development";
var settings = {
development: {
public: {},
private: {}
},
staging: {
public: {},
private: {}
},
production: {
public: {},
private: {}
}
};
if (!process.env.METEOR_SETTINGS) {
console.log("=> No METEOR_SETTINGS passed in, using locally defined settings.");
if (environment === "production") {
Meteor.settings = settings.production;
} else if (environment === "staging") {
Meteor.settings = settings.staging;
} else {
Meteor.settings = settings.development;
}
// Push a subset of settings to the client.
if (Meteor.settings && Meteor.settings.public) {
__meteor_runtime_config__.PUBLIC_SETTINGS = Meteor.settings.public;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment