<commit_before>var express = require('express'),
  http = require('http'),
  corsMiddleware = require('cors'),
  app = express(),
  master = require('./server/master.js');


var envPort = process.env.PORT || 8001;


var server = require('http').createServer(app);
var io = require('socket.io').listen(server, {
  origins: '*:*'
});

var server.listen(envPort, function() {
  console.log('Listening on port %d', server.address().port);
});

io.on('connection', function(socket) {
  //if existing servers are open..
  socket.emit('hello', {
    stopped: master.isStopped()
  });
  socket.on('hello', function(data) {
    console.log('hello ', data.deviceId);
    if (!data.deviceId) {
      console.error('device attempted to connect without an id');
      return;<commit_msg>logging/quickly debugging a production issue<commit_after>var express = require('express'),
  http = require('http'),
  corsMiddleware = require('cors'),
  app = express(),
  master = require('./server/master.js');


var envPort = process.env.PORT || 8001;


var server = require('http').createServer(app);
var io = require('socket.io').listen(server, {
  origins: '*:*'
});

server.listen(envPort, function() {
  console.log('Listening on port %d', server.address().port);
});

io.on('connection', function(socket) {
  //if existing servers are open..
  socket.emit('hello', {
    stopped: master.isStopped()
  });
  socket.on('hello', function(data) {
    console.log('hello ', data.deviceId);
    if (!data.deviceId) {
      console.error('device attempted to connect without an id');
      return;
{'fraction_non_alphanumeric': 0.18222222222222223, 'fraction_numerical': 0.005079365079365079, 'mean_word_length': 4.235880398671096, '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': '2693930', 'n_tokens_mistral': 494, 'n_tokens_neox': 487, 'n_words': 110}