<commit_before>'use strict';


var _       = require('underscore');
var angular = require('angular');

var config = {
	common: {

		// TODO Do we need to have configurable states?
		// states for the ui-router
		states: {
			main:     'main.workspace',
			board:    'main.board',
			login:    'login',
			register: 'register'
		},

		// keys used by localStorage to hold information
		// about the users identity
		userKey:  'tbuser',
		tokenKey: 'tbtoken'
	},
	development: {

		// socket.io server host and port
		io: {
			_url: 'http://' + (process.env.HOSTNAME || 'localhost'),
			_port: 9001,
		},

		// restful api url and port
		api: {
			_url:     'http://' + (process.env.HOSTNAME || 'localhost'),
			_port:    9002,
			_version: 'api/v1'
		},

		// static content provider url and port
		// serves things like board images
		static: {
			_url: 'http://' + (process.env.HOSTNAME || 'localhost'),
			_port: 9002
		}
	},
	production: {
		io: {
			_url:  process.env.IO_URL,
			_port: process.env.IO_PORT
		},
		api: {
			_url:     process.env.API_URL,
			_port:    process.env.API_PORT,
			_version: 'api/v1'
		},
		static: {
			_url:  process.env.STATIC_URL,
			_port: process.env.STATIC_PORT
		}
	}
}

config = _.extend(config.common,
	config[process.env.NODE_ENV] || config.development);

config.io.url = function() {
	return this._url + ':' + this._port;
}

config.api.url = function() {
	return this._url + ':' + this._port + '/';
}

config.static.url = function() {
	return this._url + ':' + this._port;
}

module.exports = angular.module('tb.configuration', [ ])
	.value('Config', config);<commit_msg>Use process.env.API_URL for the whole api url, including any versions and ports.<commit_after>'use strict';


var _       = require('underscore');
var angular = require('angular');

var config = {
	common: {

		// TODO Do we need to have configurable states?
		// states for the ui-router
		states: {
			main:     'main.workspace',
			board:    'main.board',
			login:    'login',
			register: 'register'
		},

		// keys used by localStorage to hold information
		// about the users identity
		userKey:  'tbuser',
		tokenKey: 'tbtoken'
	},
	development: {

		// socket.io server host and port
		io: {
			_url: 'http://' + (process.env.HOSTNAME || 'localhost'),
			_port: 9001,
		},

		// restful api url and port
		api: {
			_url:     'http://' + (process.env.HOSTNAME || 'localhost'),
			_port:    9002,
			_version: 'api/v1'
		},

		// static content provider url and port
		// serves things like board images
		static: {
			_url: 'http://' + (process.env.HOSTNAME || 'localhost'),
			_port: 9002
		}
	},
	production: {
		io: {
			_url:  process.env.IO_URL,
			_port: process.env.IO_PORT
		},
		api: {
			_url:     process.env.API_URL,
			_port:    process.env.API_PORT,
			_version: 'api/v1'
		},
		static: {
			_url:  process.env.STATIC_URL,
			_port: process.env.STATIC_PORT
		}
	}
}

config = _.extend(config.common,
	config[process.env.NODE_ENV] || config.development);

config.io.url = function() {
	return this._url + ':' + this._port;
}

config.api.url = function() {
	return this._url;
}

config.static.url = function() {
	return this._url + ':' + this._port;
}

module.exports = angular.module('tb.configuration', [ ])
	.value('Config', config);
{'fraction_non_alphanumeric': 0.16014669926650366, 'fraction_numerical': 0.008557457212713936, 'mean_word_length': 2.8370457209847597, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2754537', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1163, 'n_words': 273}