diff --git a/package.json b/package.json index 244395e..090cc8e 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "cheerio": "^0.19.0", "express": "^4.12.4", - "mongodb": "^1.4.38" + "mongodb": "^1.4.38", + "mongoskin": "^1.4.13" } } diff --git a/schedule.js b/schedule.js index b9d61e4..cbab26b 100644 --- a/schedule.js +++ b/schedule.js @@ -10,8 +10,9 @@ function lookup(req, res, next, search) { if (err) console.warn(err); if (database_entry.length == 1) { - var link = make_link(database_entry[0]); - res.redirect(link); + get(make_link(database_entry[0]), function (schedule) { + res.end(schedule); + }); } else if (database_entry.length == 0) { res.send('No matches were found in the database.'); @@ -46,4 +47,8 @@ function make_link(database_entry) { return link; } +function get(link, callback) { + console.log(link); +} + module.exports = lookup;