<commit_before>
/**
 * Module dependencies.
 */

var mod_assert = require('assert');
var mod_bunyan = require('bunyan');

var express = require('express');
var routes = require('./routes');
var user = require('./routes/user');
var http = require('http');
var path = require('path');

var LOG = mod_bunyan.createLogger({
  name: 'abusetool',
  stream: process.stdout,
  level: 'info'
});

var app = express();

app.set('logger', LOG);

// all environments
//app.set('host', process.env.HOST || '127.0.0.1');
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(express.favicon());
// bunyan logging
app.use(function(req, res, next) {
    var end = res.end;
    req._startTime = new Date();
    res.end = function(chunk, encoding){
        res.end = end;
        res.end(chunk, encoding);
        LOG.info({req: req, res: res, total_time: new Date() - req._startTime}, 'handled request/response');
    };

    next();
});
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(express.cookieParser('your secret here'));
app.use(express.session());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' === app.get('env')) {
  app.use(express.errorHandler());
}

app.get('/', routes.index);<commit_msg>Pull in secret key from the COOKIE_SECRET_KEY environment setting<commit_after>
/**
 * Module dependencies.
 */

var mod_assert = require('assert');
var mod_bunyan = require('bunyan');

var express = require('express');
var routes = require('./routes');
var user = require('./routes/user');
var http = require('http');
var path = require('path');

var LOG = mod_bunyan.createLogger({
  name: 'abusetool',
  stream: process.stdout,
  level: 'info'
});

mod_assert.ok(process.env.COOKIE_SECRET_KEY, 'env.COOKIE_SECRET_KEY');

var app = express();

app.set('logger', LOG);

// all environments
//app.set('host', process.env.HOST || '127.0.0.1');
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(express.favicon());
// bunyan logging
app.use(function(req, res, next) {
    var end = res.end;
    req._startTime = new Date();
    res.end = function(chunk, encoding){
        res.end = end;
        res.end(chunk, encoding);
        LOG.info({req: req, res: res, total_time: new Date() - req._startTime}, 'handled request/response');
    };

    next();
});
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(express.cookieParser(process.env.COOKIE_SECRET_KEY));
app.use(express.session());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' === app.get('env')) {
  app.use(express.errorHandler());
}

app.get('/', routes.index);
{'fraction_non_alphanumeric': 0.20309810671256454, 'fraction_numerical': 0.0068846815834767644, 'mean_word_length': 4.524714828897339, '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': '4338988', 'n_tokens_mistral': 995, 'n_tokens_neox': 979, 'n_words': 207}