 MongoClient = require('mongodb').MongoClient
 requireFu = require('require-fu')
 
-mongoUrl = "mongodb://127.0.0.1:27017/galegis-api-dev"
-
+# Set up the Job queue.
 jobs = kue.createQueue()
 jobs.on 'job complete', (id) ->
   kue.Job.get id, (err, job) ->

    poolSize: 10
    auto_reconnect: true

MongoClient.connect mongoUrl, mongoOptions, (err, db) ->
  # Load up routes
  requireFu(__dirname + '/routes')(app, jobs, db)


      else
        console.log 'removed completed job #%d', job.id

# Set up Express.
app = express()
app.set('port', process.env.PORT || 3000)
app.set('views', __dirname + '/views')
app.set('view engine', 'jade')
app.set('mongo url', "mongodb://127.0.0.1:27017/galegis-api-dev")
app.use(express.favicon())
app.use(express.bodyParser())
app.use(express.methodOverride())
