   config = projRequire 'server/server-config'
 
   dbName = config.mongo.db
-  address = config.mongo.host + ':' + config.mongo.port
+  address = "#{config.mongo.host}:#{config.mongo.port}"
   if config.mongo.username and config.mongo.password
-    address = config.mongo.username + ':' + config.mongo.password + '@' + address
+    address = "#{config.mongo.username}:#{config.mongo.password}@#{address}"
   address = "mongodb://#{address}/#{dbName}"
   
-  log.info "Connecting to Mongo with connection string #{address}"
+  winston.info "DB connecting to #{address}"
   mongoose.connect address
-  mongoose.connection.once 'open', -> Grid.gfs = Grid(mongoose.connection.db, mongoose.mongo)
+  mongoose.connection.once 'open', -> 
+    Grid.gfs = Grid(mongoose.connection.db, mongoose.mongo)
   
   
   #- express creation, config
   express = require 'express'
   app = express()
-  app.set('port', config.port)
-  app.set('env', if config.isProduction then 'production' else 'development')
+  app.set 'port', config.port
+  app.set 'env', if config.isProduction then 'production' else 'development'
 
   
   #- express middleware

      else if status >= 300 then color = 36
      elapsed = (new Date()) - req._startTime
      elapsedColor = if elapsed < 500 then 90 else 31
      if (status isnt 200 and status isnt 204 and status isnt 304 and status isnt 302) or elapsed > 500
        return "\x1b[90m#{req.method} #{req.originalUrl} \x1b[#{color}m#{res.statusCode} \x1b[#{elapsedColor}m#{elapsed}ms\x1b[0m"
      null
    
    express.logger.format('prod', productionLogging)
    app.use(express.logger('prod'))
    app.use express.compress filter: (req, res) ->
      return false if req.headers.host is 'codecombat.com'  # Cloudflare will gzip it for us on codecombat.com
      compressible res.getHeader('Content-Type')
  else
    app.use(express.logger('dev'))

  path = require 'path'
  useragent = require 'express-useragent'
  app.use(express.static(path.join(__dirname, '../public')))
  app.use(useragent.express())

  app.use(express.favicon())
  app.use(express.cookieParser(config.cookie_secret))
  app.use(express.bodyParser())
  app.use(express.methodOverride())
  app.use(express.cookieSession({secret:'defenestrate'}))


  #- passport middlware

winston = require 'winston'
require './projRequire'

module.exports.startServer = ->
  
  #- setup globals
  GLOBAL._ = require 'lodash'
  _.str = require 'underscore.string'
  _.mixin _.str.exports()
  global.tv4 = require 'tv4' # required for TreemaUtils to work
  
  
  #- setup logging
  winston.remove(winston.transports.Console)
  winston.add(winston.transports.Console,
    colorize: true,
    timestamp: true
  )
  
  
  #- connect to db
  Grid = require 'gridfs-stream'
