<commit_before>var express = require('express');
var app = express();
var bodyParser = require('body-parser');

var port = 3001;

app.use(bodyParser());


var servers = {};
var currentServer = 0;

// We only have two servers at the moment

// Endpoint to serve the user so that it 
app.get('/get-server-url', function (req, res) {
  if (currentServer == 0) {

  	res.send();
  }

  
});


app.post('/register-server', function (req, res) {
	if (req.body.tunnel) {
		if (req.body.server_id) {
			// var server_data = {};
			// server_data[req.body.server_id] = req.body.tunnel;
			servers[req.body.server_id] = req.body.tunnel;

			console.log(servers);
			res.send("Successfully registered server in the load balancer.");

		
		}
		
	}
});


<commit_msg>very very basic, not super amazing or fancy load balancer created<commit_after>var express = require('express');
var app = express();
var bodyParser = require('body-parser');

var port = 3001;

app.use(bodyParser());


var servers = {};
var ids = [];
var currentServer = 0;

// We only have two servers at the moment

// Endpoint to serve the user so that it 
app.get('/get-server-url', function (req, res) {
	var numRegisteredServers = 0;
	for (var id in servers) {
		numRegisteredServers++;
	}

	console.log(numRegisteredServers);


	res.send(servers[ids[currentServer]]);

	currentServer++;
  	if (currentServer > numRegisteredServers) {
  		currentServer = 0;
  	}

});


// Register the server with the load balancer
app.post('/register-server', function (req, res) {
	if (req.body.tunnel) {
		if (req.body.server_id) {
			servers[req.body.server_id] = req.body.tunnel;

			if (ids.indexOf(req.body.server_id) == -1) { // basically, if it doesn't already exist
				ids.push(req.body.server_id);
			}
			

			console.log(servers);
			console.log(ids);
			res.send("Successfully registered server in the load balancer.");
		
		} else {
			res.send(500, "There was an error registering the server with the load balancer.");
		}
		
	} else {
		res.send(500, "There was an error registering the server with the load balancer.");
	}
});



{'fraction_non_alphanumeric': 0.1462715105162524, 'fraction_numerical': 0.009560229445506692, 'mean_word_length': 3.501075268817204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4092839', 'n_tokens_mistral': 771, 'n_tokens_neox': 694, 'n_words': 193}