 app = express()
 server = http.createServer(app)
 app.set('port', process.env.PORT || 4000)
+
+mongo = require('./models/connection')
 ###
     Require routes.
 ###

    else
        user_id = parseInt(req.query.user_id)
        api_key = req.query.api_key.toString()

        mongo.db.collection('homeagain_users').findOne(
            {
                user_id: user_id,



# Init mongo connection only once
mongo.initiate (db) ->
    console.log('Connection is now established with mongoDB on homeAgain.')


