<commit_before>let express = require('express'),
	bodyParser = require('body-parser'),
	morgan = require('morgan'),
	mustacheExpress = require('mustache-express'),

	path = require('path'),

	db = require('./lib/db');

// load configuration
let config = {
	"mongo": {
		"host": "192.168.0.128",
		"port": 27017,
		"db": "g2x"
	}
}

// create app
var app = express();

// app configuration
app.set('port', (process.env.PORT || 8081));
app.set('db', db);

// configure template engine
app.engine('mustache', mustacheExpress());
app.set('view engine', 'mustache');
app.set('views', path.join(__dirname, 'views'));

// configure middleware
app.use(morgan('dev'));
app.use(express.static('public'));

// configure routes
require('./routes/static')(app);

// start server
var server = app.listen(app.get('port'), function() {
	var port = server.address().port;

	console.log("Server listening on port %s", port);

	db(config.mongo, (err, db) => {
		if (err) {
			console.error(err);
			process.exit(1);
		}

		console.log("Connected to mongo server:", config.mongo);
	});
});<commit_msg>Add imu routes and store db reference on app<commit_after>let express = require('express'),
	bodyParser = require('body-parser'),
	morgan = require('morgan'),
	mustacheExpress = require('mustache-express'),

	path = require('path'),

	db = require('./lib/db');

// load configuration
let config = {
	"mongo": {
		"host": "192.168.0.128",
		"port": 27017,
		"db": "g2x"
	}
}

// create app
var app = express();

// app configuration
app.set('port', (process.env.PORT || 8081));

// configure template engine
app.engine('mustache', mustacheExpress());
app.set('view engine', 'mustache');
app.set('views', path.join(__dirname, 'views'));

// configure middleware
app.use(morgan('dev'));
app.use(express.static('public'));

// configure routes
require('./routes/static')(app);
require('./routes/imu')(app);

// start server
var server = app.listen(app.get('port'), function() {
	var port = server.address().port;

	console.log("Server listening on port %s", port);

	db(config.mongo, (err, db) => {
		if (err) {
			console.error(err);
			process.exit(1);
		}

		app.set('db', db);
		console.log("Connected to mongo server:", config.mongo);
	});
});
{'fraction_non_alphanumeric': 0.209438202247191, 'fraction_numerical': 0.01887640449438202, 'mean_word_length': 4.469287469287469, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7077311', 'n_tokens_mistral': 807, 'n_tokens_neox': 752, 'n_words': 171}