 
 module.exports = (app) ->
 
+  # Configure Sentry
+  if SENTRY_PRIVATE_DSN
+    RavenServer.config(SENTRY_PRIVATE_DSN).install()
+    app.use RavenServer.requestHandler()
+
   # Override Backbone to use server-side sync
   Backbone.sync = require 'backbone-super-sync'
 
   # Route to ping for system up
   app.get '/system/up', (req, res) ->
     res.send 200, { nodejs: true }
-
-  # Error Reporting
-  if SENTRY_PRIVATE_DSN
-    RavenServer.config(SENTRY_PRIVATE_DSN).install()
-    app.use RavenServer.requestHandler()
 
   # Mount generic middleware & run setup modules
   if 'production' is NODE_ENV or 'staging' is NODE_ENV

  app.use express.static(path.resolve __dirname, '../../public')

  # Error handler
  require('../../components/error/server') app

  app.use bucketAssets()
  setupAuth app
  app.use locals
  app.use helpers
  app.use ua
  app.use sameOrigin
