/**
 * Created by ammarch on 6/2/14.
 */
var config = require('./config.json');

/* override for local development if NODE_ENV is defined to local */
if (process.env.NODE_ENV && (process.env.NODE_ENV.toLowerCase().indexOf("local") !== -1)) {
    config.connector.mqtt.host = "127.0.0.1";
    config.connector.rest.host = "127.0.0.1";
    config.connector.rest.port = 80;
    config.connector.rest.protocol= "http";
}
module.exports = config;

@@ -42,42 +42,338 @@
 var 
-config = require('./config.json');
+fs = require('fs'),%0A    logger = require(%22../lib/logger%22).init(),%0A    configpath = './config.json';%0A%0Aif (!fs.existsSync(configpath)) %7B%0A  var config = require('/etc/iotkit-agent/config.json');%0A  logger.debug(%22Using system config file%22);%0A%7D%0Aelse %7B%0A  var config = require('./config.json');%0A  logger.debug(%22Using local config file%22);%0A%7D
 %0A%0A/*

use global config file if local one not found