Video 50: 404 Pages
This commit is contained in:
@@ -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.')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user