 
 if process.env.NODE_ENV != "test"
     resetRoutes()
-

                appDict[installedApp.name] = installedApp
            
        haibuClient.get 'drones/running', (err, res, apps) ->
            updateApps(apps, appDict, resetProxy)

updateApps = (apps, appDict, callback) ->
    if apps? and apps.length > 0
        app = apps.pop()

Client = require('request-json').JsonClient

client = new Client 'http://localhost:9104/'
haibuClient =  new Client 'http://localhost:9002/'

# Grab all application informations listed in the database and compare 
# them to informations stored inside haibu. If port is different
# application port is updated in data system.
resetRoutes = ->
    Application.all (err, installedApps) ->
        appDict = {}
