<commit_before>const env = require('dotenv').config();
const express = require('express');
const app = express();
const port = 1337;
const bodyParser = require('body-parser');
const path = require('path');

// ------------------ Chat System --------------------
// ---------------------------------------------------

const redis = require('redis'); // TODO set up dev and prod env's
const cache = redis.createClient(process.env.REDIS_URL); // TODO need to connect via dyno and not via http
// const engine = require('./engine/engine.js'); // TODO this path needs to be replaced with the final dest of TS compiled assets
// const store = redis.createClient();   
// const pub = redis.createClient();
// const sub = redis.createClient();
cache.on('connect', err => {
  if (err) console.log(`Error connecting to cache, ${err}`);
  else console.log(`Successfully connected to cache`);
  cache.del('messages', err => { // clear out any existing data; TODO remove this once prod
    if (!err) cache.rpush('messages', 'jimmy'); // initialize chat
  }); 
});<commit_msg>cache: allow heroku to set the port<commit_after>const env = require('dotenv').config();
const express = require('express');
const app = express();
const port = process.env.PORT || 1337;
const bodyParser = require('body-parser');
const path = require('path');

// ------------------ Chat System --------------------
// ---------------------------------------------------

const redis = require('redis'); // TODO set up dev and prod env's
const cache = redis.createClient(process.env.REDIS_URL); // TODO need to connect via dyno and not via http
// const engine = require('./engine/engine.js'); // TODO this path needs to be replaced with the final dest of TS compiled assets
// const store = redis.createClient();   
// const pub = redis.createClient();
// const sub = redis.createClient();
cache.on('connect', err => {
  if (err) console.log(`Error connecting to cache, ${err}`);
  else console.log(`Successfully connected to cache`);
  cache.del('messages', err => { // clear out any existing data; TODO remove this once prod
    if (!err) cache.rpush('messages', 'jimmy'); // initialize chat
  }); 
});
{'fraction_non_alphanumeric': 0.22370848708487084, 'fraction_numerical': 0.0036900369003690036, 'mean_word_length': 2.81195079086116, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2031877', 'n_tokens_mistral': 573, 'n_tokens_neox': 566, 'n_words': 211}