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
......@@ -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) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment