<commit_before>var MongoClient = require("mongodb").MongoClient;
var express = require("express");
var cors = require("cors");
var assert = require("assert");
var waitForMongo = require("wait-for-mongo");

var app = express();
app.use(cors());

waitForMongo("mongodb://localhost/venturerealm", {
	timeout: 1000 * 60 * 2
}, function(err) {
	if (err) {
		console.log("Timeout exceeded");
	} else {
		MongoClient.connect("mongodb://localhost:27017/venturerealm", function(err, db) {
			assert.equal(null, err);
			console.log("Connected to server");

			// Serve static files
			app.use(express.static("public"));

			app.listen(8000, function() {
				console.log("Listening on :8000");
			});

			db.close();
		});
	}
});
<commit_msg>I'm an idiot but also it works<commit_after>var MongoClient = require("mongodb").MongoClient;
var express = require("express");
var cors = require("cors");
var assert = require("assert");
var waitForMongo = require("wait-for-mongo");

var app = express();
app.use(cors());

connectToMongo();

function connectToMongo() {
	MongoClient.connect("mongodb://localhost:27017/venturerealm", function(err, db) {
		if (err) {
			connectToMongo();
		}

		console.log("Connected to server");

		// Serve static files
		app.use(express.static("public"));

		app.listen(8000, function() {
			console.log("Listening on :8000");
		});

		db.close();
	});
}

{'fraction_non_alphanumeric': 0.18340611353711792, 'fraction_numerical': 0.024017467248908297, 'mean_word_length': 4.729166666666667, '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': '3035961', 'n_tokens_mistral': 533, 'n_tokens_neox': 454, 'n_words': 95}