<commit_before>var Hapi = require('hapi'),
    server = new Hapi.Server(),
    mongoose = require('mongoose'),
    glob = require('glob');

var config = require('./config.js');

server.connection({ port: config.main.port });

mongoose.connect(config.db);
var db = mongoose.connection;
db.on('error', function () {
  throw new Error('unable to connect to database at ' + config.db);
});

var models = glob.sync('./models/*.js');
models.forEach(function (model) {
  require(model);
});

mongoose.connection.collections['queuetracks'].drop( function(err) {
    console.log('old queue tracks dropped');
});

var socket = require('./modules/socketLogic.js');
socket.init(server.listener);

var mopidy = require('./modules/mopidyCom.js');
mopidy.init();

server.views({
  engines: {
    jade: require('jade')
  },
  relativeTo: __dirname,
  path: 'views',
  context: {
    website: 'Livid'
  }
});


server.route({
    method: 'GET',
    path: '/',<commit_msg>Don't drop DB while in production mode<commit_after>var Hapi = require('hapi'),
    server = new Hapi.Server(),
    mongoose = require('mongoose'),
    glob = require('glob');

var config = require('./config.js');

server.connection({ port: config.main.port });

mongoose.connect(config.db);
var db = mongoose.connection;
db.on('error', function () {
  throw new Error('unable to connect to database at ' + config.db);
});

var models = glob.sync('./models/*.js');
models.forEach(function (model) {
  require(model);
});

if (process.env.ENV !== 'prod') {
  mongoose.connection.collections['queuetracks'].drop( function(err) {
      console.log('old queue tracks dropped');
  });
}

var socket = require('./modules/socketLogic.js');
socket.init(server.listener);

var mopidy = require('./modules/mopidyCom.js');
mopidy.init();

server.views({
  engines: {
    jade: require('jade')
  },
  relativeTo: __dirname,
  path: 'views',
  context: {
    website: 'Livid'
  }
});


server.route({
    method: 'GET',
    path: '/',
{'fraction_non_alphanumeric': 0.18936708860759494, 'fraction_numerical': 0.0, 'mean_word_length': 4.079691516709511, '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': '3243293', 'n_tokens_mistral': 654, 'n_tokens_neox': 662, 'n_words': 141}