<commit_before>var express = require('express')
  , io = require('socket.io')
  , util = require('util')
  , pub = __dirname + '/public'
  , port = process.env.PORT || 8000;

// express
var app = express.createServer();
app.get('/', function(req, res) {
  res.render('index');
});
app.listen(port);

// socket.io
var ws = io.listen(app);
ws.on('connection', function(client) {
  client
    .on('message', function(data) {
      data = JSON.parse(data);
      data.sessionId = client.sessionId;

      ws.broadcast(JSON.stringify(data), client.sessionId);
    })
    .on('disconnect', function() {
      ws.broadcast(JSON.stringify({
        sessionId: client.sessionId, disconnect: true
      }));
    });
});

util.log("listening on 0.0.0.0:" + port + ".");

// config
app.configure(function() {
  app.use(require('stylus').middleware(pub));
  app.use(express.logger());
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
});

app.configure('development', function() {
  app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
  app.use(express.static(pub));
  app.set('view options', { scope: { development: true }});
});

app.configure('production', function() {
  app.use(express.errorHandler());
  app.use(express.static(pub, { maxAge: 1000 * 5 * 60 }));
  app.set('view options', { scope: { development: false }});
});
<commit_msg>let 2010 routes redirect for a bit<commit_after>var express = require('express')
  , io = require('socket.io')
  , util = require('util')
  , pub = __dirname + '/public'
  , port = process.env.PORT || 8000;

// express
var app = express.createServer();
app.get('/', function(req, res) {
  res.render('index');
});

// let 2010 routes redirect for a while
app.get(/\/(.*)\//, function(req, res, next) {
  var path = req.params[0];
  if (/^(stylesheets|javascripts|images|fonts)/.test(path)) {
    next(); // don't redirect for stylesheets and the like
  } else {
    res.redirect('http://2010.nodeknockout.com' + req.url, 301);
  }
});
app.listen(port);

// socket.io
var ws = io.listen(app);
ws.on('connection', function(client) {
  client
    .on('message', function(data) {
      data = JSON.parse(data);
      data.sessionId = client.sessionId;

      ws.broadcast(JSON.stringify(data), client.sessionId);
    })
    .on('disconnect', function() {
      ws.broadcast(JSON.stringify({
        sessionId: client.sessionId, disconnect: true
      }));
    });
});

util.log("listening on 0.0.0.0:" + port + ".");

// config
app.configure(function() {
  app.use(require('stylus').middleware(pub));
  app.use(express.logger());
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
});

app.configure('development', function() {
  app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
  app.use(express.static(pub));
  app.set('view options', { scope: { development: true }});
});

app.configure('production', function() {
  app.use(express.errorHandler());
  app.use(express.static(pub, { maxAge: 1000 * 5 * 60 }));
  app.set('view options', { scope: { development: false }});
});

{'fraction_non_alphanumeric': 0.20470664087685364, 'fraction_numerical': 0.014829142488716958, 'mean_word_length': 3.8333333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3331060', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1023, 'n_words': 202}