   restMode = if env is 'test' then 'development' else env
   # The REST server command.
   qirest = if restMode? then "qirest --#{ restMode }" else 'qirest'
-  
+
   # The callback after the REST server is started.
   start_eve = ->
     # The server port.

      env = app.settings.env
      console.log "The qiprofile server is listening on port #{ port }" +
                  " in #{ env } mode."
  
  # Start the REST app without logging to the console.
  spawn(qirest, QIREST_PORT, start_eve, {silent: true})


    '/var/log/qiprofile.log'
  catch err
    './log/qiprofile.log'

# The log file is either set in the environment or defaults to
# log/qiprofile.log in the current directory.
relLogFile = app.get('log') or defaultLogFile()
