       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
+      if (status not in [200, 204, 302, 304]) 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')
+    express.logger.format 'prod', productionLogging
+    app.use express.logger('prod')
+    app.use express.compress()
   else
-    app.use(express.logger('dev'))
+    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'}))
+  app.use express.favicon()
+  app.use express.cookieParser(config.cookie_secret)
+  app.use express.bodyParser()
+  app.use express.methodOverride()
+  app.use express.cookieSession({secret:'2EqPfxTEqUtRXVfZygLR'})
 
 
   #- passport middlware

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

# TOGO: Where should this go?
do (setupGlobals = this) ->
  GLOBAL._ = require 'lodash'
  _.str = require 'underscore.string'
  _.mixin _.str.exports()
  global.tv4 = require 'tv4' # required for TreemaUtils to work

module.exports.startServer = ->
  
  #- setup logging
  log.remove(log.transports.Console)
  log.add(log.transports.Console,
    colorize: true,
    timestamp: true
  )

  
  #- connect to db
  Grid = require 'gridfs-stream'

  # TODO: setup api routes

  
  #- Serve main.html
  fs = require 'graceful-fs'
  try
    mainHTML = fs.readFileSync(path.join(__dirname, '../public', 'main.html'), 'utf8')
  catch e
    log.error "Error modifying main.html: #{e}"

  app.all '*', (req, res) ->
    # insert the user object directly into the html so the application can have it immediately. Sanitize </script>
#      data = mainHTML.replace('"userObjectTag"', JSON.stringify(UserHandler.formatEntity(req, req.user)).replace(/\//g, '\\/'))
    res.header 'Cache-Control', 'no-cache, no-store, must-revalidate'
    res.header 'Pragma', 'no-cache'
    res.header 'Expires', 0
    res.send 200, mainHTML
  
  
  http = require 'http'
  http.createServer(app).listen(app.get('port'))
  winston.info('Express server listening on port ' + app.get('port'))
  app

  