1
0
Fork 0

Video 50: 404 Pages

This commit is contained in:
Jason Williams 2019-10-08 17:35:52 -06:00
parent 3bc267a057
commit f6dd0c90ff
2 changed files with 31 additions and 0 deletions

View File

@ -46,6 +46,22 @@ app.get('/weather', (req, res) => {
})
})
app.get('/help/*', (req, res) => {
res.render('404', {
errorMessage: 'Help article not found.',
title: '404',
name: 'Jason Williams'
})
})
app.get('*', (req, res) => {
res.render('404', {
errorMessage: 'Page not found.',
title: '404',
name: 'Jason Williams'
})
})
app.listen(4200, () => {
console.log('Server is up on port 4200.')
})

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/css/styles.css">
</head>
<body>
{{>header}}
<p>{{errorMessage}}</p>
{{>footer}}
</body>
</html>