<commit_before>"use strict"

###
Module dependencies.
###

express    = require("express")
mongoStore = require("connect-mongo")(express)
flash      = require("connect-flash")

module.exports = (app, passport, db, config) ->
  app.set "showStackError", true

  # Prettify HTML
  app.locals.pretty = true

  # Should be placed before express.static
  # To ensure that all assets and data are compressed (utilize bandwidth)
  app.use express.compress
    filter: (req, res) ->
      /json|text|javascript|css|html/.test res.getHeader "Content-Type"

    # Levels are specified in a range of 0 to 9, where-as 0 is
    # no compression and 9 is best compression, but slowest
    level: 9

  # Only use logger for development enviroment
  app.use express.logger "dev" if process.env.NODE_ENV is "development"

  app.configure ->
    # The cookieParser should be above session
    app.use express.cookieParser

    # Request body paring middleware should be above methodOverride
    app.use express.urlencoded()
    app.use express.json()
    app.use express.methodOverride()

    # Express/Mongo session storage
    app.use express.session<commit_msg>fix typo<commit_after>"use strict"

###
Module dependencies.
###

express    = require("express")
mongoStore = require("connect-mongo")(express)
flash      = require("connect-flash")

module.exports = (app, passport, db, config) ->
  app.set "showStackError", true

  # Prettify HTML
  app.locals.pretty = true

  # Should be placed before express.static
  # To ensure that all assets and data are compressed (utilize bandwidth)
  app.use express.compress
    filter: (req, res) ->
      /json|text|javascript|css|html/.test res.getHeader "Content-Type"

    # Levels are specified in a range of 0 to 9, where-as 0 is
    # no compression and 9 is best compression, but slowest
    level: 9

  # Only use logger for development enviroment
  app.use express.logger "dev" if process.env.NODE_ENV is "development"

  app.configure ->
    # The cookieParser should be above session
    app.use express.cookieParser()

    # Request body paring middleware should be above methodOverride
    app.use express.urlencoded()
    app.use express.json()
    app.use express.methodOverride()

    # Express/Mongo session storage
    app.use express.session
{'fraction_non_alphanumeric': 0.09698558322411534, 'fraction_numerical': 0.00436871996505024, 'mean_word_length': 3.4901960784313726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4546439', 'n_tokens_mistral': 686, 'n_tokens_neox': 651, 'n_words': 222}