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

Merge branch 'lastToucanUrl' into 'master'

Last toucan url

See merge request !5
parents 4d763cb5 045b231a
No related branches found
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