 
     app.configure ->
       app.use(express.compress())
-
-      if liveReloadEnabled
-        grunt.log.writeln("Connected LiveReload middleware on port: #{liveReloadPort}")
-        app.use(require('connect-livereload')(
-          port: liveReloadPort
-        ))
-
+      configureLiveReloadMiddleware(app)
       app.use(express.static("#{process.cwd()}/#{webRoot}"))
       mountUserStaticRoutes(app, webRoot, staticRoutes)
 

    apiProxyPrefix  = grunt.config.get("server.apiProxy.prefix") || undefined
    apiProxyHost = grunt.config.get("server.apiProxy.host") || "localhost"
    apiProxyChangeOrigin = grunt.config.get("server.apiProxy.changeOrigin") || true
    liveReloadEnabled = grunt.config.get("server.liveReload.enabled")
    liveReloadPort = grunt.config.get("server.liveReload.port")
    webPort = process.env.WEB_PORT || grunt.config.get("server.web.port") || 8000
    webRoot = grunt.config.get("server.base") || "generated"
    staticRoutes = grunt.config.get("server.staticRoutes")

    pushStateEnabled = grunt.config.get("server.pushState")
    relativeUrlRoot = grunt.config.get("server.relativeUrlRoot")
    @requiresConfig("server.apiProxy.prefix") if pushStateEnabled and apiProxyEnabled

    app = express()
    server = http.createServer(app)

