cylon/lib/config.js

33 lines
612 B
JavaScript
Raw Normal View History

/*
* cylon configuration loader
* cylonjs.com
*
* Copyright (c) 2013 The Hybrid Group
* Licensed under the Apache 2.0 license.
*/
(function() {
var fetch, namespace;
namespace = require('node-namespace');
fetch = function(variable, defaultValue) {
if (defaultValue == null) {
defaultValue = false;
}
if (process.env[variable] != null) {
return process.env[variable];
} else {
return defaultValue;
}
};
2014-02-20 04:57:37 +08:00
namespace('CylonConfig', function() {
return this.testing_mode = fetch("CYLON_TEST", false);
});
2014-02-20 04:57:37 +08:00
module.exports = CylonConfig;
}).call(this);