<commit_before>var http = require('http');
var express = require('express');
var app = express();
var compression = require('compression');
var cors = require('cors');

var _ = require('lodash');
var jade = require('jade');

var jsonData = require('./data/offlinify-data.json');
var jsonDataBig = require('./data/offlinify-data-big.json');

// view setup
app.set('views', './views');
app.set('view engine', 'jade');

// compression:
app.use(compression({level: 9}));

// static files
app.use('/static', express.static('static'));

// routes
app.get('/', function(req, res) {
	res.render('index', {title: 'This is a title', message: 'This is text'});
});

// api
app.get('/api/get', function(req, res) {
	var filteredData = jsonData;
	if(req.query.after) {
      filteredData = _.filter(filteredData, function(o) {
        return Date.parse(o.timestamp) > Date.parse(req.query.after);<commit_msg>Re-added CORS<commit_after>var http = require('http');
var express = require('express');
var app = express();
var compression = require('compression');
var cors = require('cors');

var _ = require('lodash');
var jade = require('jade');

var jsonData = require('./data/offlinify-data.json');
var jsonDataBig = require('./data/offlinify-data-big.json');

// view setup
app.set('views', './views');
app.set('view engine', 'jade');

// compression:
app.use(compression({level: 9}));

// CORS:
app.use(cors());

// static files
app.use('/static', express.static('static'));

// routes
app.get('/', function(req, res) {
	res.render('index', {title: 'This is a title', message: 'This is text'});
});

// api
app.get('/api/get', function(req, res) {
	var filteredData = jsonData;
	if(req.query.after) {
      filteredData = _.filter(filteredData, function(o) {
        return Date.parse(o.timestamp) > Date.parse(req.query.after);
{'fraction_non_alphanumeric': 0.20803522289488166, 'fraction_numerical': 0.001100715465052284, 'mean_word_length': 4.611111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6751510', 'n_tokens_mistral': 607, 'n_tokens_neox': 600, 'n_words': 138}