summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/boot/wire-up-components-into.js4
-rw-r--r--app/infrastructure/__tests__/configuration_spec.js24
-rw-r--r--app/infrastructure/configuration.js16
3 files changed, 8 insertions, 36 deletions
diff --git a/app/boot/wire-up-components-into.js b/app/boot/wire-up-components-into.js
index 7875bdf..5950171 100644
--- a/app/boot/wire-up-components-into.js
+++ b/app/boot/wire-up-components-into.js
@@ -20,9 +20,7 @@ export default class WireUpComponentsInto {
});
}).asSingleton();
this.registry.register('applicationStorage', ApplicationStorage).asSingleton();
- this.registry.register('configuration', () => {
- return new Configuration('development');
- }).asSingleton();
+ this.registry.register('configuration', Configuration).asSingleton();
this.registry.register('api', Api).asSingleton();
this.registerSubscribers(commands);
diff --git a/app/infrastructure/__tests__/configuration_spec.js b/app/infrastructure/__tests__/configuration_spec.js
index 5caeb55..b534f83 100644
--- a/app/infrastructure/__tests__/configuration_spec.js
+++ b/app/infrastructure/__tests__/configuration_spec.js
@@ -3,27 +3,11 @@ import Configuration from '../configuration';
describe("Configuration", ()=> {
let subject = null;
- describe("development", () => {
- beforeEach(()=> {
- subject = new Configuration('development');
- });
-
- it ("loads the api host", function() {
- expect(
- subject.value_for("API_HOST")
- ).toEqual('http://localhost:3000')
- });
+ beforeEach(() => {
+ subject = new Configuration();
});
- describe("production", () => {
- beforeEach(()=> {
- subject = new Configuration('production');
- });
-
- it ("loads the api host", function() {
- expect(
- subject.value_for("API_HOST")
- ).toEqual('https://www.stronglifters.com')
- });
+ it ("loads the api host", function() {
+ expect(subject.value_for("API_HOST")).toEqual('https://www.stronglifters.com')
});
});
diff --git a/app/infrastructure/configuration.js b/app/infrastructure/configuration.js
index 03b8600..c05163d 100644
--- a/app/infrastructure/configuration.js
+++ b/app/infrastructure/configuration.js
@@ -1,20 +1,10 @@
var _defaults = {
- development: {
- API_HOST: 'http://localhost:3000',
- ENV: 'development'
- },
- production: {
- API_HOST: 'https://www.stronglifters.com',
- ENV: 'production'
- }
+ API_HOST: 'https://www.stronglifters.com',
+ ENV: 'production'
};
export default class Configuration {
- constructor(environment) {
- this.environment = environment;
- }
-
value_for(key) {
- return process.env[key] || _defaults[this.environment][key];
+ return process.env[key] || _defaults[key];
}
}