   theHub = req.app.hub
   theFeed.unshift activity
   theHub.distribute activity, localURL("feed.json"), (err) ->
-
+    if err
+      console.error err
+    else
+      console.dir {message: "distributed", activity: activity.id}
   res.writeHead 201
   res.end()
 

exports.publish = (req, res) ->
  res.render "publish",
    title: "Help for publishers"


exports.subscribe = (req, res) ->
  res.render "subscribe",

    "<" + localURL("hub") + ">; rel=\"hub\""
    "<" + localURL("feed.json") + ">; rel=\"self\""
  ]
  
  res.writeHead 200,
    "Content-Type": "application/json"

