<commit_before>var express = require('express'),
    Bookshelf = require('bookshelf'),
    http = require('http'),
    browserify = require('browserify-middleware'),
    nunjucks = require('nunjucks');



var app = express();

var conf = require('./config');
app.db = Bookshelf.initialize(conf.database);
app.models = require('./models')(app);

nunjucks.configure(__dirname + '/views', {
  autoescape: true,
  express   : app
});


app.get('/application.js', browserify('./client/index.js', {transform: ['reactify']}));
app.use('/api', require('./api'));
app.get('/:hash', function(req, res, next) {
  var hash = req.param('hash');
  new app.models.Participant({hash: hash}).fetch().then(function(model) {
    if (!model) return next();
    res.render('app.html', model.toJSON());
  });

});
app.get('/', function(req, res) {
  res.render('index.html');
});


var server = http.createServer(app);
server.listen(process.env.PORT || 1337, function() {
  console.log('Listening on http://localhost:%d', server.address().port);
});
<commit_msg>Catch error<commit_after>var express = require('express'),
    Bookshelf = require('bookshelf'),
    http = require('http'),
    browserify = require('browserify-middleware'),
    nunjucks = require('nunjucks');



var app = express();

var conf = require('./config');
app.db = Bookshelf.initialize(conf.database);
app.models = require('./models')(app);

nunjucks.configure(__dirname + '/views', {
  autoescape: true,
  express   : app
});


app.get('/application.js', browserify('./client/index.js', {transform: ['reactify']}));
app.use('/api', require('./api'));
app.get('/:hash', function(req, res, next) {
  var hash = req.param('hash');
  new app.models.Participant({hash: hash}).fetch().then(function(model) {
    if (!model) return next();
    res.render('app.html', model.toJSON());
  }, next);

});
app.get('/', function(req, res) {
  res.render('index.html');
});


var server = http.createServer(app);
server.listen(process.env.PORT || 1337, function() {
  console.log('Listening on http://localhost:%d', server.address().port);
});

{'fraction_non_alphanumeric': 0.21928982725527832, 'fraction_numerical': 0.003838771593090211, 'mean_word_length': 4.6811989100817435, 'pattern_counts': {'":': 0, '<': 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': '6446641', 'n_tokens_mistral': 685, 'n_tokens_neox': 668, 'n_words': 128}