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

var fs = require('fs');
var express = require('express');

exports.boot = function(app){
  bootApplication(app);
  bootControllers(app);
};

// App settings and middleware

function bootApplication(app) {
  app.use(express.logger(':method :url :status'));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(express.cookieParser());
  app.use(express.session({ secret: 'keyboard cat' }));
  app.use(app.router);
  app.use(express.static(__dirname + '/public'));

/* TODO: uncomment this when live so we don't see dirty errors
  // Example 500 page
  app.use(function(err, req, res, next){
    res.render('500');
  });
*/

  // Example 404 page via simple Connect middleware
  app.use(function(req, res){
    res.render('404', {locals: {url:'', luser: null}});
  });

  // Setup ejs views as default, with .html as the extension
  app.set('views', __dirname + '/views');
  app.register('.html', require('ejs'));
  app.set('view engine', 'html');

  // we always want a user object, campaign id and admin variable
  app.set('view options', {
    luser: null,
    campaignId: null,
    isAdmin: false,
    adminEmail: '<EMAIL>' //TODO: make this a config setting
  });

  // Some dynamic view helpers
  app.dynamicHelpers({
    request: function(req){
      return req;
    },

    hasMessages: function(req){<commit_msg>added development specific settings<commit_after>
/**
 * Module dependencies.
 */

var fs = require('fs');
var express = require('express');

exports.boot = function(app){
  bootApplication(app);
  bootControllers(app);
};

// App settings and middleware

function bootApplication(app) {

	app.configure('development', function(){
		app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
	});
	
	app.configure('development', function(){
		app.use(function(err, req, res, next){
   			res.render('500');
 		});
	});

	app.use(express.logger(':method :url :status'));
	app.use(express.bodyParser());
	app.use(express.methodOverride());
	app.use(express.cookieParser());
	app.use(express.session({ secret: 'keyboard cat' }));
	app.use(app.router);
	app.use(express.static(__dirname + '/public'));

	// Example 404 page via simple Connect middleware
	app.use(function(req, res){
		res.render('404', {locals: {url:'', luser: null}});
	});

	// Setup ejs views as default, with .html as the extension
	app.set('views', __dirname + '/views');
	app.register('.html', require('ejs'));
	app.set('view engine', 'html');
	
	// we always want a user object, campaign id and admin variable
	app.set('view options', {
		luser: null,
		campaignId: null,
		isAdmin: false,
		adminEmail: '<EMAIL>' //TODO: make this a config setting
	});

  // Some dynamic view helpers
  app.dynamicHelpers({
    request: function(req){
      return req;
    },

    hasMessages: function(req){
{'fraction_non_alphanumeric': 0.17049408489909534, 'fraction_numerical': 0.007306889352818371, 'mean_word_length': 4.052724077328647, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6895896', 'n_tokens_mistral': 941, 'n_tokens_neox': 902, 'n_words': 239}