lib/utilities.js
function(config) {
		// get the options for the right server setup
		var out = {},
			serverMode = (process.env.NODE_ENV) ? process.env.NODE_ENV : 'development';

		// loop object properties and add them to root of out object
		for (var key in config.environments[serverMode]) {
			if (config.environments[serverMode].hasOwnProperty(key)) {
				out[key] = config.environments[serverMode][key];
			}
		}

		if (process.env.HOST) {
			out.server.host = process.env.HOST;
		}
		if (process.env.PORT) {
			out.server.port = parseInt(process.env.PORT, 10);
		}


		// add modulus information
		if (process.env.SERVO_ID && process.env.CLOUD_DIR) {
			this.host = this.host ? this.host : {};
			this.host.clouddir = process.env.CLOUD_DIR;
			this.host.servoid = process.env.SERVO_ID;
		}


		return out;
	}
function(config) {
		// get the options for the right server setup
		var out = {},
			serverMode = (process.env.NODE_ENV) ? process.env.NODE_ENV : 'development';

		// loop object properties and add them to root of out object
		for (var key in config.environments[serverMode]) {
			if (config.environments[serverMode].hasOwnProperty(key)) {
				out[key] = config.environments[serverMode][key];
			}
		}

		if (process.env.HOST) {
			out.server.host = process.env.HOST;
		}
		if (process.env.PORT) {
			out.server.port = parseInt(process.env.PORT, 10);
		}


		// add modulus information
		if (process.env.SERVO_ID && process.env.CLOUD_DIR) {
			this.host = this.host ? this.host : {};
			this.host.clouddir = process.env.CLOUD_DIR;
			this.host.servoid = process.env.SERVO_ID;
		}


		return out;
	}
function ( config ) { // get the options for the right server setup var out = { } , serverMode = ( process . env . NODE_ENV ) ? process . env . NODE_ENV : 'development' ; // loop object properties and add them to root of out object for ( var key in config . environments [ serverMode ] ) { if ( config . environments [ serverMode ] . hasOwnProperty ( key ) ) { out [ key ] = config . environments [ serverMode ] [ key ] ; } } if ( process . env . HOST ) { out . server . host = process . env . HOST ; } if ( process . env . PORT ) { out . server . port = parseInt ( process . env . PORT , 10 ) ; } // add modulus information if ( process . env . SERVO_ID && process . env . CLOUD_DIR ) { this . host = this . host ? this . host : { } ; this . host . clouddir = process . env . CLOUD_DIR ; this . host . servoid = process . env . SERVO_ID ; } return out ; }
refines configure using server context
refines configure using server context