<commit_before>var express = require('express');
var app = express();
var nodeServer = require('http').Server(app);
//var mongo = require('mongodb');
//var database = require('./database.js');
var io = require('socket.io').listen(nodeServer);
var clients = [];
app.set('socketPort', 39000);
app.set('port', 80);
//app.set('port', 8000); DEBUG USE ONLY
app.use(express.static(__dirname));

app.get('/', function (req, res) {
	res.sendFile(__dirname + req.url);
});

io.on('connection', function (socket) {
	console.log('A user connected to ID ' + socket.id);
	clients.push(socket);

	socket.on('msg', function (msg) {
		console.log('Incoming message: ' + msg);
		socket.broadcast.emit('incoming message', msg);
	});

	socket.on('private msg', function (pmsg) {
		console.log('Incoming pm: ' + pmsg);
		//TODO
	})

	socket.on('disconnect', function () {
		var toRemove = clients.indexof(socket);
		if (index != -1) {
			clients.splice(index, 1);
			console.log('A user disconnected from ID ' + socket.id);
		}
	});
})

app.post('/signin', function (req, res) {
	console.log("Login Post request received");
	console.log("UN: " + req.username + " PW: " + req.password);
});

app.post('/register', function (req, res) {
	console.log("Register Post request received");
	console.log("UN: " + req.username + " PW: " + req.password);
	console.log("" + req[0]); //TODO
});

app.listen(app.get('port'), function () {
  console.log("Node app is running on port:" + app.get('port'));
});

nodeServer.listen(app.get('socketPort'), function () {
	console.log("Socket.io server is listening to port " + 
		app.get('socketPort'));
});<commit_msg>Clients list isn't ready yet<commit_after>var express = require('express');
var app = express();
var nodeServer = require('http').Server(app);
//var mongo = require('mongodb');
//var database = require('./database.js');
var io = require('socket.io').listen(nodeServer);
var clients = [];
app.set('socketPort', 39000);
app.set('port', 80);
//app.set('port', 8000); DEBUG USE ONLY
app.use(express.static(__dirname));

app.get('/', function (req, res) {
	res.sendFile(__dirname + req.url);
});

io.on('connection', function (socket) {
	console.log('A user connected to ID ' + socket.id);
	//clients.push(socket.id);

	socket.on('msg', function (msg) {
		console.log('Incoming message: ' + msg);
		socket.broadcast.emit('incoming message', msg);
	});

	socket.on('private msg', function (pmsg) {
		console.log('Incoming pm: ' + pmsg);
		//TODO
	})

	socket.on('disconnect', function () {
		/*var toRemove = clients.indexof(socket);
		if (index != -1) {
			clients.splice(index, 1);
			console.log('A user disconnected from ID ' + socket.id);
		}*/
		console.log('A user disconnected from ID ' + socket.id);
	});
})

app.post('/signin', function (req, res) {
	console.log("Login Post request received");
	console.log("UN: " + req.username + " PW: " + req.password);
});

app.post('/register', function (req, res) {
	console.log("Register Post request received");
	console.log("UN: " + req.username + " PW: " + req.password);
	console.log("" + req[0]); //TODO
});

app.listen(app.get('port'), function () {
  console.log("Node app is running on port:" + app.get('port'));
});

nodeServer.listen(app.get('socketPort'), function () {
	console.log("Socket.io server is listening to port " + 
		app.get('socketPort'));
});
{'fraction_non_alphanumeric': 0.20951810835079318, 'fraction_numerical': 0.008380724334031727, 'mean_word_length': 4.496710526315789, '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': '429256', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1112, 'n_words': 258}