From cc184652ef70e3855455c9addc508acab9faa32f Mon Sep 17 00:00:00 2001 From: kuryaki Date: Fri, 14 Dec 2012 05:39:25 -0500 Subject: [PATCH] Routes for subscriptions and events --- app.js | 2 ++ routes/event.js | 0 routes/index.js | 6 +++++- routes/subscription.js | 15 +++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 routes/event.js create mode 100644 routes/subscription.js diff --git a/app.js b/app.js index 8e5548b..91c7960 100644 --- a/app.js +++ b/app.js @@ -32,6 +32,8 @@ app.configure('development', function(){ }); app.get('/', routes.index); +app.post('/subscription', routes.subscription); +app.post('/event/:login/:repository', routes.events); http.createServer(app).listen(app.get('port'), function(){ diff --git a/routes/event.js b/routes/event.js new file mode 100644 index 0000000..e69de29 diff --git a/routes/index.js b/routes/index.js index bf4e313..eb13dbb 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1 +1,5 @@ -exports.index = require("./main.js").home; \ No newline at end of file +exports.index = require('./main.js').home; + +exports.subscription = require('./subscription.js').create; + +exports.event = require('./event.js').create; \ No newline at end of file diff --git a/routes/subscription.js b/routes/subscription.js new file mode 100644 index 0000000..4f7fb31 --- /dev/null +++ b/routes/subscription.js @@ -0,0 +1,15 @@ +var kue = require('kue'); + +exports.create = function(req, res){ + var client = kue.redis; + + console.log(req.body); + + client.get('https://github.com/kuryaki.atom', function(error, data){ + + console.log(data); + + }); + + res.send(200); +}; \ No newline at end of file