// Generated by CoffeeScript 1.7.1
(function() {
  var app, express, fHandleEvent, fHandleEventGet;

  express = require('express');

  app = express();

  app.post('/event', fHandleEvent);

  app.get('/event', fHandleEventGet);

  app.listen(8111);

  fHandleEvent = function(req, resp) {
    var body;
    console.log('received something with POST!');
    body = '';
    req.on('data', function(data) {
      return body += data;
    });
    req.on('end', function() {
      var err, obj;
      console.log('got foreign event!');
      console.log(body);
      try {
        obj = JSON.parse(body);
        return console.log('successfully parsed');
      } catch (_error) {
        err = _error;
        return console.log(err);
      }
    });
    return resp.send(200, 'Cheers!');
  };

  fHandleEventGet = function(req, resp) {
    console.log('received something with GET!');
    return resp.send(200, 'Cheers!');
  };

}).call(this);
