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

Last toucan url

parent 4d763cb5
Branches
No related tags found
1 merge request!5Last toucan url
......@@ -106,6 +106,20 @@ router.route("/delete/:id")
});
});
router.get('/dernierToucan', (req, res) => {
Toucan.find()
.sort({date:-1})
.limit(1)
.exec(function (err, toucan) {
if (err) {res.send(err);}
else {
const id = toucan[0]._id;
res.sendFile(path.resolve(env.savedExtensions[1].path,id+".pdf"));
}
});
});
// Renvoie la cover du toucan avec l'id donné
router.route("/img/:id")
.get(celebrate({params: validId}),function(req,res) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment