I'm retarded, switched req, with res
This commit is contained in:
parent
3aaa765a58
commit
4fd90684e8
10
schedule.js
10
schedule.js
|
@ -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));
|
||||||
|
|
Loading…
Reference in a new issue