Allow storage of bot configuration

This commit is contained in:
Chris Blanchard 2015-09-05 17:26:56 +01:00
parent e161ddddbd
commit b71805ffd3

View file

@ -8,16 +8,28 @@ var path = require("path");
var baseConfig = require(path.join(__dirname, path.join("environments/" + env.toLowerCase())));
if (!test && process.env.PORT) {
baseConfig.steamBot = {};
if (!test) {
if (process.env.PORT) {
baseConfig.port = parseInt(process.env.PORT, 10);
}
if (!test && process.env.MONGOLAB_URI) {
if (process.env.MONGOLAB_URI) {
baseConfig.mongo.uri = process.env.MONGOLAB_URI;
}
if (!test && process.env.RAILS_SECRET) {
if (process.env.RAILS_SECRET) {
baseConfig.secret_token = process.env.RAILS_SECRET;
}
if (process.env.GATHER_STEAM_ACCOUNT) {
baseConfig.steamBot.account_name = process.env.GATHER_STEAM_ACCOUNT;
}
if (process.env.GATHER_STEAM_PASSWORD) {
baseConfig.steamBot.password = process.env.GATHER_STEAM_PASSWORD;
}
}
module.exports = baseConfig;