Switch between environments easily for UI framework

#1

If you have multiple environments you need to switch between for your uiFrameworkServer, you can specify all these different configurations in a single object and extend a base export in your C3Server.js:

function extend(target) {
    var sources = [].slice.call(arguments, 1);
    sources.forEach(function (source) {
        for (var prop in source) {
            target[prop] = source[prop];
        }
    });
    return target;
}

var environmentConfig = {
   environment1_dev: { url: 'http://abc.c3-iot.com', tenant: 'package1', tag: 'dev', environment: 'development', username: 'hello@website.com', password: 'password' },
   environment1_prod: { url: 'http://abc.c3-iot.com', tenant: 'package1', tag: 'prod', environment: 'production', username: 'hello@website.com', password: 'password' },
   environment2: { url: 'http://xyz.c3-iot.com', tenant: 'package2', tag: 'prod', environment: 'production', username: 'hello@website.com', password: 'password' }
};


module.exports = extend({}, {
    repos: ['/path/to/your/c3base/base', '/path/to/your/c3customer/customer']
}, environmentConfig.environment1_dev );