Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSSP 2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Laboratoire de linguistique formelle
Websites
Conferences
CSSP 2023
Commits
e793367f
Commit
e793367f
authored
1 year ago
by
Alexandre Roulois
Browse files
Options
Downloads
Patches
Plain Diff
Catch 404
parent
1e9f029e
No related branches found
Branches containing commit
No related tags found
2 merge requests
!25
Main
,
!24
Develop
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
routes/index.js
+7
-2
7 additions, 2 deletions
routes/index.js
with
7 additions
and
2 deletions
routes/index.js
+
7
−
2
View file @
e793367f
...
...
@@ -4,14 +4,19 @@ var router = express.Router();
const
i18next
=
require
(
'
i18next
'
);
/* GET page. */
router
.
get
(
'
/:page?
'
,
function
(
req
,
res
,
next
)
{
router
.
get
(
'
/:page?
'
,
(
req
,
res
,
next
)
=>
{
const
page
=
req
.
params
.
page
?
req
.
params
.
page
:
'
home
'
;
const
title
=
req
.
params
.
page
?
req
.
params
.
page
.
toUpperCase
()
:
'
HOME
'
;
res
.
render
(
`
${
req
.
language
}
/
${
page
}
`
,
{
title
:
req
.
t
(
`TITLES.
${
title
}
`
)
});
},
(
err
,
html
)
=>
{
if
(
err
)
{
res
.
status
(
404
);
res
.
render
(
'
404
'
,
{
title
:
'
404
'
});
}
else
res
.
send
(
html
);
})
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment