summaryrefslogtreecommitdiff
path: root/app/infrastructure/configuration.js
blob: 3bcf5890a69bed3c09deba275455acf88c95bb09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var _defaults = {
  API_HOST: 'https://www.stronglifters.com',
  ENV: 'production',
};

export default class Configuration {
  constructor(overrides = _defaults) {
    this.overrides = Object.assign({}, _defaults, overrides);
  }

  value_for(key) {
    return process.env[key] || this.overrides[key];
  }

  isEnabled(key) {
    return this.value_for(key) == "true";
  }
}