<commit_before>#!/usr/bin/env node
var express = require('express');
var exphbs = require('express-handlebars');
var app = express();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
var port = process.env.PORT || 8080;
require("coffee-script/register")

app.engine('handlebars', exphbs({defaultLayout: 'main'}));
app.set('view engine', 'handlebars');

server.listen(port, function () {
  console.log('Server listening at port %d', port);
});

////////////////////////////////////////////////////
// Database stuff

DbHelper = require('./helpers/db_helper')

////////////////////////////////////////////////////
// Models
var Player = require('./models/player');

var Game = require('./models/game');
    game = new Game(io, DbHelper, {
        maxScore: 10,
        maxSeconds: 15
    });

////////////////////////////////////////////////////
// RPC methods
app.get('/rpc/words', function(req, res) {
    res.send(game.getWords());
});

// Returns a list dictionary { word: count, ...}
app.get('/rpc/wordcounts', function(req, res) {
    res.send(game.getWordCounts());
});

require('./pages/games.coffee')(app, DbHelper);

app.use('/', express.static(__dirname + '/public'));

////////////////////////////////////////////////////
// Socket.io
io.on('connection', function (socket) {
  console.log("CONNECTION");

  socket.on('start game', function () {
    game.startGame();
  });
  
  socket.on('set topic', function(topic) {
    game.setTopic(topic);
  });

  socket.on('new player', function (playerName) {<commit_msg>Change default time limit back to 2 minutes<commit_after>#!/usr/bin/env node
var express = require('express');
var exphbs = require('express-handlebars');
var app = express();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
var port = process.env.PORT || 8080;
require("coffee-script/register")

app.engine('handlebars', exphbs({defaultLayout: 'main'}));
app.set('view engine', 'handlebars');

server.listen(port, function () {
  console.log('Server listening at port %d', port);
});

////////////////////////////////////////////////////
// Database stuff

DbHelper = require('./helpers/db_helper')

////////////////////////////////////////////////////
// Models
var Player = require('./models/player');

var Game = require('./models/game');
    game = new Game(io, DbHelper, {
        maxScore: 10,
        maxSeconds: 120
    });

////////////////////////////////////////////////////
// RPC methods
app.get('/rpc/words', function(req, res) {
    res.send(game.getWords());
});

// Returns a list dictionary { word: count, ...}
app.get('/rpc/wordcounts', function(req, res) {
    res.send(game.getWordCounts());
});

require('./pages/games.coffee')(app, DbHelper);

app.use('/', express.static(__dirname + '/public'));

////////////////////////////////////////////////////
// Socket.io
io.on('connection', function (socket) {
  console.log("CONNECTION");

  socket.on('start game', function () {
    game.startGame();
  });
  
  socket.on('set topic', function(topic) {
    game.setTopic(topic);
  });

  socket.on('new player', function (playerName) {
{'fraction_non_alphanumeric': 0.30383761496986994, 'fraction_numerical': 0.005708848715509039, 'mean_word_length': 2.32, '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': '6822961', 'n_tokens_mistral': 924, 'n_tokens_neox': 891, 'n_words': 193}