From 4fd90684e8b08b635dbf1a565fe1738b80b06823 Mon Sep 17 00:00:00 2001 From: Bram van der Veen <96aa48@gmail.com> Date: Sat, 13 Jun 2015 22:36:18 +0200 Subject: [PATCH] I'm retarded, switched req, with res --- schedule.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/schedule.js b/schedule.js index 353a812..795a156 100644 --- a/schedule.js +++ b/schedule.js @@ -3,10 +3,10 @@ var http = require('http'); var cheerio = require('cheerio'); //Wrapper function that is being called by express. -function schedule(res, req, match) { - get(req.req.match.url, function (json) { - req.req.match.json = json; - res.res.send(json); +function schedule(req, res, next) { + get(req.match.url, function (json) { + req.match.json = json; + next(); }); } @@ -17,7 +17,7 @@ function get(url, callback) { res.on('data', function (data) { _download += data; - }) + }); res.on('end', function () { callback(to_json(_download));