<commit_before>/**
 * Created by dfurman on 12/7/15.
 */

var app = require('express')();
var server = require('http').Server(app);
var io = require('socket.io')(server);

server.listen(3000);

app.get('/', function(request, response){
	response.sendFile(__dirname + '/index.html');
});

io.on('connection', function(socket){
	socket.on('chat.message', function(message) {
		io.emit('chat.message', message);
	});
});<commit_msg>Added basic functionality to watch for user disconnection, then notify the group that the user has left.<commit_after>/**
 * Created by dfurman on 12/7/15.
 */

var app = require('express')();
var server = require('http').Server(app);
var io = require('socket.io')(server);

server.listen(3000);

app.get('/', function(request, response){
	response.sendFile(__dirname + '/index.html');
});

io.on('connection', function(socket){
	socket.on('chat.message', function(message) {
		io.emit('chat.message', message);
	});

	socket.on('disconnect', function() {
		io.emit('chat.message', 'User has disconnected');
	});
});
{'fraction_non_alphanumeric': 0.20382775119617225, 'fraction_numerical': 0.01722488038277512, 'mean_word_length': 5.378048780487805, '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': '7495583', 'n_tokens_mistral': 348, 'n_tokens_neox': 330, 'n_words': 76}