           cb())
       else
         cb()
-    )
 
   #### Middleware ####
   #

  echoSocket     = new WebSocketServer({server: app, path: '/system/echo'})
  logWatchSocket = new WebSocketServer({server: app, path: '/system/logwatch'})
  counterSocket  = new WebSocketServer({server: app, path: '/system/counter'})
  echoSocket.on('connection', (ws) ->
    ws.on('message', (message) ->
      log 'socktest message from client:', message
      ws.send message, (e) ->
        if e
          log 'unable to send ws message:', e
          return
    )
  )
  logWatchSocket.on('connection', (ws) ->
    logWatchSocket.on('fetch', fetchListener = (page) ->
      reference =
        title: page.title
        listeners: logWatchSocket.listeners('fetch').length

      async.map files, doSitemap, (e, sitemap) ->
        if e then return res.e e
        res.json(sitemap.filter (item) -> if item? then true)


  ##### Put routes #####

  app.put /^\/page\/([a-z0-9-]+)\/action$/i, authenticated, (req, res) ->
    action = JSON.parse(req.body.action)
    # Handle all of the possible actions to be taken on a page,
    actionCB = (e, page, status) ->
