<commit_before>#    galegis-api -- Structured Importing and RESTful providing of GA General Assembly Activity.
#    Copyright (C) 2013 <NAME>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
express = require('express')
http = require('http')
path = require('path')
kue = require('kue')
MongoClient = require('mongodb').MongoClient

mongoUrl = "mongodb://127.0.0.1:27017/galegis-api-dev"

jobs = kue.createQueue()
app = express()

# all environments
app.set('port', process.env.PORT || 3000)
app.set('views', __dirname + '/views')
app.set('view engine', 'jade')
app.use(express.favicon())
app.use(express.logger('dev'))
app.use(express.bodyParser())
app.use(express.methodOverride())
app.use(express.cookieParser('your secret here'))
app.use(express.session())
app.use(app.router)
app.use('/kue', kue.app)
app.use(require('stylus').middleware(__dirname + '/public'))
app.use(express.static(path.join(__dirname, 'public')))

# development only
if 'development' == app.get('env')
  app.use(express.errorHandler())

mongoOptions =
  db:
    w: 1
  server:
    poolSize: 10
    auto_reconnect: true

MongoClient.connect mongoUrl, mongoOptions, (err, db) ->
  # Load up routes<commit_msg>Alter app bootstrap behavior in production mode.<commit_after>#    galegis-api -- Structured Importing and RESTful providing of GA General Assembly Activity.
#    Copyright (C) 2013 <NAME>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
express = require('express')
http = require('http')
path = require('path')
kue = require('kue')
MongoClient = require('mongodb').MongoClient

mongoUrl = ""

jobs = kue.createQueue()
app = express()

# all environments
app.set('port', process.env.PORT || 3000)
app.set('views', __dirname + '/views')
app.set('view engine', 'jade')
app.use(express.favicon())
app.use(express.bodyParser())
app.use(express.methodOverride())
app.use(express.cookieParser('your secret here'))
app.use(express.session())
app.use(app.router)
app.use(require('stylus').middleware(__dirname + '/public'))
app.use(express.static(path.join(__dirname, 'public')))

# development only
if 'development' == app.get('env')
  mongoUrl = "mongodb://127.0.0.1:27017/galegis-api-dev"

  app.use(express.logger('dev'))
  app.use(express.errorHandler())
  app.use('/kue', kue.app)

# production only
if 'production' == app.get('env')
  mongoUrl = "mongodb://127.0.0.1:27017/galegis-api"

  app.use(express.logger('default'))

  kueUser = process.env.KUEUSER || "kue"
  kuePass = process.env.KUEPASS || "<PASSWORD>"
  app.use('/kue', express.basicAuth(kueUser, kuePass), kue.app)

mongoOptions =
  db:
    w: 1
  server:
    poolSize: 10
    auto_reconnect: true

MongoClient.connect mongoUrl, mongoOptions, (err, db) ->
  # Load up routes
{'fraction_non_alphanumeric': 0.13378856853818918, 'fraction_numerical': 0.014415781487101669, 'mean_word_length': 4.315860215053763, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 3, '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': '1002504', 'n_tokens_mistral': 1286, 'n_tokens_neox': 1229, 'n_words': 384}