I'm retarded, switched req, with res

This commit is contained in:
Bram van der Veen 2015-06-13 22:36:18 +02:00
parent 3aaa765a58
commit 4fd90684e8

View file

@ -3,10 +3,10 @@ var http = require('http');
var cheerio = require('cheerio'); var cheerio = require('cheerio');
//Wrapper function that is being called by express. //Wrapper function that is being called by express.
function schedule(res, req, match) { function schedule(req, res, next) {
get(req.req.match.url, function (json) { get(req.match.url, function (json) {
req.req.match.json = json; req.match.json = json;
res.res.send(json); next();
}); });
} }
@ -17,7 +17,7 @@ function get(url, callback) {
res.on('data', function (data) { res.on('data', function (data) {
_download += data; _download += data;
}) });
res.on('end', function () { res.on('end', function () {
callback(to_json(_download)); callback(to_json(_download));