<commit_before>var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);

//Deliver index.html with client javascript code
app.get('/', function(req, res){
    res.sendFile(__dirname + '/index.html');
});


//Create server socket for client connection
io.on('connection', function(socket){
    console.log('a user connected');

    socket.on('chat message', function (msg) {
        console.log('message: ' + msg);
        io.emit('chat messages', msg);
    })

    //socket.on('disconnect', function(){  //Create disconnect, if client refreshes/exits index.html
    //    console.log('user disconnect');
    //});
});


http.listen(3000, function(){
    console.log('listening on *:3000');
});<commit_msg>FIX Use port from environment<commit_after>var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);

//Deliver index.html with client javascript code
app.get('/', function(req, res){
    res.sendFile(__dirname + '/index.html');
});


//Create server socket for client connection
io.on('connection', function(socket){
    console.log('a user connected');

    socket.on('chat message', function (msg) {
        console.log('message: ' + msg);
        io.emit('chat messages', msg);
    })

    //socket.on('disconnect', function(){  //Create disconnect, if client refreshes/exits index.html
    //    console.log('user disconnect');
    //});
});


var port = normalizePort(process.env.PORT || '3000');
http.listen(port, function(){
    console.log('listening on port ' + port);
});
{'fraction_non_alphanumeric': 0.18553459119496854, 'fraction_numerical': 0.007547169811320755, 'mean_word_length': 3.8212121212121213, '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': '5338043', 'n_tokens_mistral': 488, 'n_tokens_neox': 461, 'n_words': 119}