Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
API Toucan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Damien Armillon
API Toucan
Merge requests
!5
Last toucan url
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Last toucan url
lastToucanUrl
into
master
Overview
0
Commits
3
Pipelines
0
Changes
1
Merged
Last toucan url
Inès Yeterian
requested to merge
lastToucanUrl
into
master
Feb 10, 2022
Overview
0
Commits
3
Pipelines
0
Changes
1
add
https://api.toucan.cs-campus.fr/toucan/dernierToucan
route to fix broken link with LinkCS
0
0
Merge request reports
Viewing commit
ff2e761c
Prev
Next
Show latest version
1 file
+
12
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
ff2e761c
add dernierToucan url
· ff2e761c
Inès Yeterian
authored
Feb 10, 2022
backend/routes/routesToucan.js
+
12
−
0
View file @ ff2e761c
Edit in single-file editor
Open in Web IDE
Show full file
@@ -106,6 +106,18 @@ router.route("/delete/:id")
});
});
router
.
get
(
'
/dernierToucan
'
,
(
req
,
res
)
=>
{
Toucan
.
find
()
.
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
)
{
Loading