Skip to content
Snippets Groups Projects
Commit edd11326 authored by Inès Yeterian's avatar Inès Yeterian
Browse files

try with .match and .exec

parent ed560b80
Branches
No related tags found
1 merge request!4Url/year/title
...@@ -154,4 +154,21 @@ router.route("/pdf/:urlID") ...@@ -154,4 +154,21 @@ router.route("/pdf/:urlID")
} }
);}); );});
router.get('/pdf/:urlID', (req, res) => {
try {
urltoucans.match({urlID: req.parameters.urlID})
.exec((err, data) => {
if (err) {
console.log(err);
res.sendStatus(500);
} else {
res.send(data);
}
});
} catch (err) {
console.log(err);
res.sendStatus(401);
}
});
module.exports = router; module.exports = router;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment