<commit_before>'use strict';

var fs = require('fs');
var express = require('express');
var path = require('path');
var WebSocketServer = require('ws').Server;
var http = require('http');
	
var PORT = 3000;


var app = express();
app.use(express.static(path.join(__dirname, 'www')));

app.get('/', function (req, res) {
	res.sendFile(path.join(__dirname, 'www', 'index.html'));
});

app.get('/api/reviews', function (req, res) {
	Storage.getRecentReviews().then(function (reviews) {
		res.json(reviews);
	}, function (err) {
		res.status(500).end();
	});
});
app.get('/api/review/:id', function (req, res) {
	var fileName = path.join(__dirname, 'reviews', req.params.id + '.db');
	fs.stat(fileName, function (err, stats) {
		if (err || !stats || !stats.isFile()) {
			res.sendStatus(404);
		} else {
			res.sendFile(fileName);
		}
	})
});

var server = http.createServer(app);
server.listen(PORT);

<commit_msg>switched off review database download<commit_after>'use strict';

var fs = require('fs');
var express = require('express');
var path = require('path');
var WebSocketServer = require('ws').Server;
var http = require('http');
	
var PORT = 3000;


var app = express();
app.use(express.static(path.join(__dirname, 'www')));

app.get('/', function (req, res) {
	res.sendFile(path.join(__dirname, 'www', 'index.html'));
});

app.get('/api/reviews', function (req, res) {
	Storage.getRecentReviews().then(function (reviews) {
		res.json(reviews);
	}, function (err) {
		res.sendStatus(500);
	});
});
app.get('/api/review/:id', function (req, res) {
	var fileName = path.join(__dirname, 'reviews', req.params.id + '.db');
	fs.stat(fileName, function (err, stats) {
		if (err || !stats || !stats.isFile()) {
			res.sendStatus(404);
		} else {
			res.end('Review download not yet implemented!');
		}
	})
});

var server = http.createServer(app);
server.listen(PORT);


{'fraction_non_alphanumeric': 0.20973782771535582, 'fraction_numerical': 0.010700909577314071, 'mean_word_length': 4.771604938271605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3642054', 'n_tokens_mistral': 685, 'n_tokens_neox': 650, 'n_words': 142}