<commit_before>var monk = require('monk');
var db = monk('localhost:27017/riot_challenge');

module.exports = db;
<commit_msg>Add connection to production db when using cfapps [delivers #101345778]<commit_after>var monk = require('monk');

var uri = 'localhost:27017/riot_challenge'
if (process.env["VCAP_SERVICES"]) {
  var vcap_services = JSON.parse(process.env["VCAP_SERVICES"]);
  uri = vcap_services.mongolab[0].credentials.uri;
}

var db = monk(uri);
module.exports = db;

{'fraction_non_alphanumeric': 0.14644351464435146, 'fraction_numerical': 0.04184100418410042, 'mean_word_length': 6.484375, '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': '552092', 'n_tokens_mistral': 187, 'n_tokens_neox': 162, 'n_words': 35}