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

var express = require('express')
  , passport = require('passport')
  , nowww = require('nowww')
  , log = require('debug')('root:config')
  , MongoStore = require('connect-mongo')(express)
  , path = require('path')
  , config = require('lib/config');

/**
 * Expose `Config`
 *
 * @api private
 */

module.exports = Config;

/**
 * Configs Express Application with
 * defaults configs
 */

function Config(app) {
  /**
   * Set `development` only settings
   */

  app.configure('development', function() {

    // Log config settigs load
    log( 'development settings' );

    /**
     * Build
     */

    app.use(require('lib/build').middleware);

  });


  /**
   * Set `testing` only settings
   */

  app.configure('testing', function() {

    // Log config settigs load
    log( 'testing settings' );

  });


  /**
   * Set `production` only settings
   */

  app.configure('production', function() {

    // Log config settigs load
    log( 'production settings' );

    /**
     * Set `nowww` middleware helper
     */

    app.use( nowww() );
    
    /**
     * Set `native` express compression middleware
     */

    app.use( express.compress() );
    
  });

  /**
   * Set `common` settings
   */

  app.configure(function() {
    // Log config settigs load
    log( 'common settings' );

    /**
     * Save config in app
     */
    
    app.set('config', config);

    /**
     * Set `mongoUrl` from config settings
     */

    app.set( 'mongoUrl', config('mongoUrl') );

    /**
     * Set application http server port from `env`
     * Defaults to 3005
     */

    app.set( 'port', process.env.PORT || 3005 );
    
    /**
     * Set `public-assets` default path
     */

    app.use( express.static( path.join(__dirname, '..', '/public') ) );
    
    /**
     * Configure native `express` body parser
     */

    app.use( express.bodyParser() );
    
    /**
     * Configure native `express` cookie parser
     */

    app.use( express.cookieParser('democracyos-cookie') );
    
    /**<commit_msg>[config] - Save port from config module<commit_after>/**
 * Module dependencies.
 */

var express = require('express')
  , passport = require('passport')
  , nowww = require('nowww')
  , log = require('debug')('root:config')
  , MongoStore = require('connect-mongo')(express)
  , path = require('path')
  , config = require('lib/config');

/**
 * Expose `Config`
 *
 * @api private
 */

module.exports = Config;

/**
 * Configs Express Application with
 * defaults configs
 */

function Config(app) {
  /**
   * Set `development` only settings
   */

  app.configure('development', function() {

    // Log config settigs load
    log( 'development settings' );

    /**
     * Build
     */

    app.use(require('lib/build').middleware);

  });


  /**
   * Set `testing` only settings
   */

  app.configure('testing', function() {

    // Log config settigs load
    log( 'testing settings' );

  });


  /**
   * Set `production` only settings
   */

  app.configure('production', function() {

    // Log config settigs load
    log( 'production settings' );

    /**
     * Set `nowww` middleware helper
     */

    app.use( nowww() );
    
    /**
     * Set `native` express compression middleware
     */

    app.use( express.compress() );
    
  });

  /**
   * Set `common` settings
   */

  app.configure(function() {
    // Log config settigs load
    log( 'common settings' );

    /**
     * Save config in app
     */
    
    app.set('config', config);

    /**
     * Set `mongoUrl` from config settings
     */

    app.set( 'mongoUrl', config('mongoUrl') );

    /**
     * Set application http server port from `env`
     * Defaults to 3005
     */

    app.set( 'port', config('port') || 3005 );
    
    /**
     * Set `public-assets` default path
     */

    app.use( express.static( path.join(__dirname, '..', '/public') ) );
    
    /**
     * Configure native `express` body parser
     */

    app.use( express.bodyParser() );
    
    /**
     * Configure native `express` cookie parser
     */

    app.use( express.cookieParser('democracyos-cookie') );
    
    /**
{'fraction_non_alphanumeric': 0.16594827586206898, 'fraction_numerical': 0.0038314176245210726, 'mean_word_length': 2.213076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, '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': '5346369', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1268, 'n_words': 299}