var http = require('http'),
      pandaCounter = 0;

http.createServer(function (req, res) {
  var payload = "";

  console.log(req.url.indexOf("/createPanda"));
  console.log(req.method);

  if(req.url.indexOf("/createPanda") === 0) {
    pandaCounter+= 1;
    res.end("Panda counter = " + pandaCounter);
  }

  req.on('data', function(chunk) {
    console.log("Received body data:");
    console.log(chunk.toString());
    payload += chunk.toString();
  });

  req.on('end', function() {
    console.log(JSON.parse(payload));
    // empty 200 OK response for now
    res.writeHead(200, "OK", {'Content-Type': 'text/html'});
    res.end("PANDATIGAN");
  });

}).listen(8080);

@@ -132,35 +132,11 @@
 .url
-.indexOf(%22/createPanda%22)
 );%0A
+
   co
@@ -163,129 +163,8 @@
 );%0A%0A
-  if(req.url.indexOf(%22/createPanda%22) === 0) %7B%0A    pandaCounter+= 1;%0A    res.end(%22Panda counter = %22 + pandaCounter);%0A  %7D%0A%0A
   re
@@ -346,78 +346,24 @@
     
-console.log(JSON.parse(payload));%0A    // empty 200 OK response for now
+pandaCounter ++;
 %0A   
@@ -443,17 +443,33 @@
 NDATIGAN
-%22
+ %22 + pandaCounter
 );%0A  %7D);

Fix test server