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');
|
||||
|
||||
//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));
|
||||
|
|
Loading…
Reference in a new issue