 stashError = (req, err) ->
   if (config && config.stashError)
     config.stashError(req, err)
- 
+
 
 getController = (controllerName) ->
   require("#{config.paths.controllerDir}/#{controllerName}_controller")


# define routes
exports.routes = () ->
  clientRoutes = require(config.paths.clientRouter)
  routeSpecs = []
  for own path, routeInfo of clientRoutes
    action = getAction(routeInfo)
    handler = getHandler(action, routeInfo)
    routeSpecs.push(['get', "/#{path}", routeInfo.role, handler])

#   - errorHandler: function to correctly handle error
#   - paths
#     - entryPath (required)
#     - routes (optional)
#     - controllerDir (optional)
#   - stashPerf: optional function to store performance stats
#   - stashError: optional function to notify server of error
