<commit_before>var express = require( "express" );
var app = express();
var MongoClient = require('mongodb').MongoClient;
var format = require('util').format;
var cors = require('cors');
var bodyParser = require('body-parser');

app.use(cors());
app.use(bodyParser.urlencoded({ extended: false }));

MongoClient.connect('mongodb://127.0.0.1:27017/fontfamilyreunion', function(err, db) {
	if(err) throw err;

	app.route('/save')
		.get(function(req, res, next) {
			res.send( "Use post." );
		})
		.post(function(req, res, next) {
			var ua = req.param( "ua" );
			var families = req.param( "families" ).split( ',' );
console.log( 'saving', ua, families );

			var collection = db.collection('fontfamilies');
			collection.insert({
				ua: ua,
				families: families
			}, function( err ) {
				if( err ) {
					throw err;
				}
			});
<commit_msg>Insert date with results<commit_after>var express = require( "express" );
var app = express();
var MongoClient = require('mongodb').MongoClient;
var format = require('util').format;
var cors = require('cors');
var bodyParser = require('body-parser');

app.use(cors());
app.use(bodyParser.urlencoded({ extended: false }));

MongoClient.connect('mongodb://127.0.0.1:27017/fontfamilyreunion', function(err, db) {
	if(err) throw err;

	app.route('/save')
		.get(function(req, res, next) {
			res.send( "Use post." );
		})
		.post(function(req, res, next) {
			var ua = req.param( "ua" );
			var families = req.param( "families" ).split( ',' );
console.log( 'saving', ua, families );

			var collection = db.collection('fontfamilies');
			collection.insert({
				ua: ua,
				families: families,
				date: (new Date()).toString()
			}, function( err ) {
				if( err ) {
					throw err;
				}
			});

{'fraction_non_alphanumeric': 0.1879310344827586, 'fraction_numerical': 0.01264367816091954, 'mean_word_length': 3.890449438202247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3454428', 'n_tokens_mistral': 692, 'n_tokens_neox': 590, 'n_words': 138}