<commit_before>express = require 'express'
mongoose = require 'mongoose'
ext_type = require 'connect-ext-type'
{ createServer } = require 'http'
{ join } = require 'path'

module.exports = express().configure ->
  @set 'port', process.env.PORT or 8070
  @set 'host', process.env.HOST or '127.0.0.1'
  @set 'view engine', 'jade'
  @set 'views', join __dirname, 'views'
  @set 'url', process.env.URL or "http://localhost:#{@settings.port}/"
  @enable 'trust proxy' if process.env.PROXIED

  @locals
    url: @settings.url
    blockchain_api: process.env.BLOCKCHAIN_API
    pubkey_address: process.env.PUBKEY_ADDRESS
    pretty: @settings.env is 'development'

  @db = mongoose.connect process.env.MONGO_URI or 'mongodb://localhost/'
  @models = require('./models')(@db)

  @use express.basicAuth 'u2', '<PASSWORD>'
  @use express.favicon()
  @use express.logger 'dev'
  @use express.json()
  @use express.urlencoded()
  @use express.methodOverride()
  @use ext_type '.json': 'application/json', '.txt': 'text/plain'

  server = createServer this
  require('./websocket').call(this, server)
  require('./assets').call(this) if (@settings.env is 'development') or process.env.SERVE_ASSETS
  # assets are pre-compiled and served by nginx on production

  @use '/u', require('./user')(this)

  server.listen @settings.port, @settings.host, => console.log "Listening on #{@settings.host}:#{@settings.port}"<commit_msg>Remove basicAuth from express (added to nginx instead)<commit_after>express = require 'express'
mongoose = require 'mongoose'
ext_type = require 'connect-ext-type'
{ createServer } = require 'http'
{ join } = require 'path'

module.exports = express().configure ->
  @set 'port', process.env.PORT or 8070
  @set 'host', process.env.HOST or '127.0.0.1'
  @set 'view engine', 'jade'
  @set 'views', join __dirname, 'views'
  @set 'url', process.env.URL or "http://localhost:#{@settings.port}/"
  @enable 'trust proxy' if process.env.PROXIED

  @locals
    url: @settings.url
    blockchain_api: process.env.BLOCKCHAIN_API
    pubkey_address: process.env.PUBKEY_ADDRESS
    pretty: @settings.env is 'development'

  @db = mongoose.connect process.env.MONGO_URI or 'mongodb://localhost/'
  @models = require('./models')(@db)

  @use express.favicon()
  @use express.logger 'dev'
  @use express.json()
  @use express.urlencoded()
  @use express.methodOverride()
  @use ext_type '.json': 'application/json', '.txt': 'text/plain'

  server = createServer this
  require('./websocket').call(this, server)
  require('./assets').call(this) if (@settings.env is 'development') or process.env.SERVE_ASSETS
  # assets are pre-compiled and served by nginx on production

  @use '/u', require('./user')(this)

  server.listen @settings.port, @settings.host, => console.log "Listening on #{@settings.host}:#{@settings.port}"
{'fraction_non_alphanumeric': 0.16211422490244767, 'fraction_numerical': 0.007449450159631075, 'mean_word_length': 4.3919694072657744, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4287594', 'n_tokens_mistral': 959, 'n_tokens_neox': 922, 'n_words': 234}