   router.buildRoutes(server)
   initLibs(callback)
 
+exports.setDataAdapter = (dataAdapter) ->
+  exports.dataAdapter = dataAdapter
+
 # Use default, stubbed dataAdapter.
 # To be overridden by application.
-module.exports.dataAdapter = dataAdapter
+exports.setDataAdapter(dataAdapter)
 
 #
 # options

closeLibs = (callback) ->
  callback()

stubApiProxy = (req, res, next) ->
  next('API PROXY: You need to setup a custom API proxy by mounting middleware at "/api"')

    runUserMiddleware()

    server.use(server.router)
    server.use('/api', apiProxy())

  server.configure 'test', ->
    server.use(express.errorHandler({ dumpExceptions: true, showStack: true }))
