     app.configure ->
       app.use(express.static("#{process.cwd()}/#{webRoot}"))
 
-      if apiProxyEnabled and pushStateEnabled
-        grunt.log.writeln("Proxying API requests prefixed with '#{apiProxyPrefix}' to #{apiProxyHost}:#{apiPort}")
-        app.use(prefixMatchingApiProxy(apiProxyPrefix, apiProxyHost, apiPort, new httpProxy.RoutingProxy()))
-      else if apiProxyEnabled
-        grunt.log.writeln("Proxying API requests to #{apiProxyHost}:#{apiPort}")
-        app.use(apiProxy(apiProxyHost, apiPort, new httpProxy.RoutingProxy()))
+      userConfig.drawRoutes(app) if userConfig.drawRoutes
+      addBodyParserCallbackToRoutes(app)
+
+      if apiProxyEnabled
+        if pushStateEnabled
+          grunt.log.writeln("Proxying API requests prefixed with '#{apiProxyPrefix}' to #{apiProxyHost}:#{apiPort}")
+          app.use(prefixMatchingApiProxy(apiProxyPrefix, apiProxyHost, apiPort, new httpProxy.RoutingProxy()))
+        else
+          grunt.log.writeln("Proxying API requests to #{apiProxyHost}:#{apiPort}")
+          app.use(apiProxy(apiProxyHost, apiPort, new httpProxy.RoutingProxy()))
 
       app.use(express.bodyParser())
       app.use(express.errorHandler())

    return (req, res, next) ->
      proxy.proxyRequest(req, res, {host, port})


  resetRoutesOnServerConfigChange = (app) ->
    watchr grunt.file.expand('config/server.*'), (err, watcher) ->

          if userConfig.drawRoutes
            _(app.routes).each (route, name) -> app.routes[name] = []
            userConfig.drawRoutes(app)
            addBodyParserCallbackToRoutes(app.routes)
