<commit_before>var polyfillio = require('../lib');
var express = require('express');
var app = express().enable("strict routing");
var origamijson = require('../origami.json');
var PolyfillSet = require('./PolyfillSet');
var fs = require('fs');
var path = require('path');
var URL = require('url');
var metrics = require('./metrics');
var testing = require('./testing');
var docs = require('./docs');
var appVersion = require(path.join(__dirname,'../package.json')).version;
var hostname = require("os").hostname();

'use strict';

var one_day = 60 * 60 * 24;
var one_week = one_day * 7;
var one_year = one_day * 365;
var contentTypes = {".js": 'application/javascript', ".css": 'text/css'};
var dateDeployed;

require('fs').stat(path.join(__dirname,'../package.json'), function(err, stat) {
	dateDeployed = stat.mtime;
})

// Set up Sentry (getsentry.com) to collect JS errors.
// Raven provides an automatic no-op client if a DSN is not set
new require('raven').Client(process.env.SENTRY_DSN);

// Default cache control policy
app.use(function(req, res, next) {
	res.set('Cache-Control', 'public, max-age='+one_week+', stale-while-revalidate='+one_week+', stale-if-error='+one_week);
	res.set('Timing-Allow-Origin', '*');
	res.removeHeader("x-powered-by");
	return next();
});


/* Tests */

app.use('/test/libs/mocha', express.static(path.join(__dirname, '/../node_modules/mocha')));
app.use('/test/libs/expect', express.static(path.join(__dirname, '/../node_modules/expect.js/')));

app.get(/\/test\/director\/?$/, testing.createEndpoint('director', polyfillio));
app.get(/\/test\/tests\/?$/, testing.createEndpoint('runner', polyfillio));

<commit_msg>Fix Raven syntax<commit_after>var polyfillio = require('../lib');
var express = require('express');
var app = express().enable("strict routing");
var origamijson = require('../origami.json');
var PolyfillSet = require('./PolyfillSet');
var fs = require('fs');
var path = require('path');
var URL = require('url');
var metrics = require('./metrics');
var testing = require('./testing');
var docs = require('./docs');
var appVersion = require(path.join(__dirname,'../package.json')).version;
var hostname = require("os").hostname();

'use strict';

var one_day = 60 * 60 * 24;
var one_week = one_day * 7;
var one_year = one_day * 365;
var contentTypes = {".js": 'application/javascript', ".css": 'text/css'};
var dateDeployed;

require('fs').stat(path.join(__dirname,'../package.json'), function(err, stat) {
	dateDeployed = stat.mtime;
})

// Set up Sentry (getsentry.com) to collect JS errors.
// Raven provides an automatic no-op client if a DSN is not set
var Raven = require('raven');
var ravenClient = new Raven.Client(process.env.SENTRY_DSN);
ravenClient.patchGlobal();

// Default cache control policy
app.use(function(req, res, next) {
	res.set('Cache-Control', 'public, max-age='+one_week+', stale-while-revalidate='+one_week+', stale-if-error='+one_week);
	res.set('Timing-Allow-Origin', '*');
	res.removeHeader("x-powered-by");
	return next();
});


/* Tests */

app.use('/test/libs/mocha', express.static(path.join(__dirname, '/../node_modules/mocha')));
app.use('/test/libs/expect', express.static(path.join(__dirname, '/../node_modules/expect.js/')));

app.get(/\/test\/director\/?$/, testing.createEndpoint('director', polyfillio));
app.get(/\/test\/tests\/?$/, testing.createEndpoint('runner', polyfillio));


{'fraction_non_alphanumeric': 0.20910973084886128, 'fraction_numerical': 0.005915409642117717, 'mean_word_length': 5.08273381294964, 'pattern_counts': {'":': 4, '<': 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': '5956777', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1098, 'n_words': 246}