Added get function, haven't made it work yet.

This commit is contained in:
Bram van der Veen 2015-06-13 16:01:07 +02:00
parent 3fc23d6ca8
commit 0985d4663c
2 changed files with 9 additions and 3 deletions

View file

@ -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"
}
}

View file

@ -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;