<commit_before>var fs = require('fs'),
    path = require('path'),
    express = require('express'),
    passport = require('passport'),
    async = require('async'),
    marked = require('marked');

/**
 * Loads in the configuration then extends and updates it based on the view
 * and application overrides.d
 * @private
 */
var configure = function(config) {
  // load and extend the various config files
  this.config = require(__dirname + '/config');

  var appConfig = path.resolve('./config.json');
  if(fs.existsSync(appConfig)) {
    this.config = this.util.extend(this.config, require(appConfig));
  }

  this.config = this.util.extend(this.config, (config || {}));

  // base application path
  this.config.__path = process.cwd();

  if(!this.config.view.hasOwnProperty('module')) {
    throw 'No view layer found.';
  }

  this.config.view.path = __dirname +
    '/node_modules/' + this.config.view.module;

  this.config.view = app.view = this.util.extend(
    this.config.view,
    require(this.config.view.module)(this)
  );
};

/**
 * Initializes the server.
 * @private
 */
var initialize = function() {
  // load the express extentions/shims
  require('./lib/express_ext')(this.app);

  this.app.use(require('static-favicon')(this.config.favicon));

  // load some required/common middleware
  this.app.use(require('body-parser')());
  this.app.use(passport.initialize());

  // set up the view configuration
  var view = this.config.view;
  this.app.use(express.static('./public'));             // application
  this.app.use(express.static(view.path + '/public')); // theme
  
  this.app.engine(view.ext, view.engine);
  this.app.set('view engine', view.ext);
  this.app.set('views', [
    './views',             // application
    view.path + '/views', // theme
  ]);

  // set up passport to use basic auth
  var BasicStrategy = require('passport-http').BasicStrategy;

  passport.use(new BasicStrategy(
    function(username, password, done) {
      done(null, (username === this.username && password === this.password));
    }.bind(this.config.authentication)
  ));

  // convenience for passport digest authentication
  this.restrict = passport.authenticate('basic', {session:false});
};

/**
 * Scroll Core Class
 * @class
 * @name Scroll<commit_msg>Added a check that allows no view engine to be used.<commit_after>var fs = require('fs'),
    path = require('path'),
    express = require('express'),
    passport = require('passport'),
    async = require('async'),
    marked = require('marked');

/**
 * Loads in the configuration then extends and updates it based on the view
 * and application overrides.d
 * @private
 */
var configure = function(config) {
  // load and extend the various config files
  this.config = require(__dirname + '/config');

  var appConfig = path.resolve('./config.json');
  if(fs.existsSync(appConfig)) {
    this.config = this.util.extend(this.config, require(appConfig));
  }

  this.config = this.util.extend(this.config, (config || {}));

  // base application path
  this.config.__path = process.cwd();

  if(!this.config.view.hasOwnProperty('module')) {
    throw 'No view layer found.';
  }

  this.config.view.path = __dirname +
    '/node_modules/' + this.config.view.module;

  this.config.view = app.view = this.util.extend(
    this.config.view,
    require(this.config.view.module)(this)
  );
};

/**
 * Initializes the server.
 * @private
 */
var initialize = function() {
  // load the express extentions/shims
  require('./lib/express_ext')(this.app);

  this.app.use(require('static-favicon')(this.config.favicon));

  // load some required/common middleware
  this.app.use(require('body-parser')());
  this.app.use(passport.initialize());

  // set up the paths for static files
  var view = this.config.view;
  this.app.use(express.static('./public'));             // application
  this.app.use(express.static(view.path + '/public')); // theme

  // set up the view engine, if any
  if(typeof view.engine !== 'undefined' && view.engine !== null) {
    this.app.engine(view.ext, view.engine);
    this.app.set('view engine', view.ext);
    this.app.set('views', [
      './views',             // application
      view.path + '/views', // theme
    ]);
  }

  // set up passport to use basic auth
  var BasicStrategy = require('passport-http').BasicStrategy;

  passport.use(new BasicStrategy(
    function(username, password, done) {
      done(null, (username === this.username && password === <PASSWORD>));
    }.bind(this.config.authentication)
  ));

  // convenience for passport digest authentication
  this.restrict = passport.authenticate('basic', {session:false});
};

/**
 * Scroll Core Class
 * @class
 * @name Scroll
{'fraction_non_alphanumeric': 0.16422349691948163, 'fraction_numerical': 0.0, 'mean_word_length': 3.3391705069124424, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1123403', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1405, 'n_words': 325}