
module.exports = function(robot)  {
  robot.router.post('/hubot/github-hooks', function(req, res) {
    var data = null;

    if(req.body) {
      try {
        data = JSON.parse(req.body);
      } 
      catch(e) {
        robot.logger.error("Invalid JSON submitted to /hubot/github-hooks");
        //res.send(422)
        res.send('You supplied an invalid JSON to this endpoint.');
        return;
      }
    } 
    else {
      robot.logger.error("Non-JSON submitted to  /hubot/github-hooks");
      //res.send(422)
      res.send('You supplied an invalid JSON to this endpoint.');
      return;
    }


  });
}

@@ -116,16 +116,72 @@
  null;%0A%0A
+    robot.logger.info(%22Github post received: %22, req);%0A%0A%0A
     if(r
@@ -658,16 +658,40 @@
 %0A    %7D%0A%0A
+    console.log(data);%0A%0A
 %0A  %7D);%0A%7D

update slack-msg0callback