var http = require("http");

var gpio = require('gpio');
var gate = null;

http.createServer(function(request, response) {

  if (request.url == "/check") {
    response.write("The server is running.")
  }
  else if (request.url == "/run") {
    if (request.method != "POST") {
      response.write("POST is required.")
      response.statusCode = 405;
    }
    else {
      if (!gate) {
        gate = gpio.export(4, {
          direction: 'out',
          interval: 200,
          ready: function() {
            setTimeout( function() {
              gate.set(1);
            }, 300);
          }
        });
      }

      gate.set(0, function() {
        setTimeout( function() {
          gate.set(1);
        }, 300);
      });
    }
  }

  response.end();

}).listen(8888);

@@ -194,16 +194,17 @@
 nning.%22)
+;
 %0A  %7D%0A  e
@@ -313,16 +313,17 @@
 uired.%22)
+;
 %0A      r

add semicolons