send 404 for txt file not exists
This commit is contained in:
parent
244665db1c
commit
c8213a4ddc
|
@ -204,6 +204,15 @@ app.get('*', function(req, res){
|
|||
} else {
|
||||
error = true
|
||||
}
|
||||
// If txt-file isn't found, give the 404
|
||||
if (error) {
|
||||
const back = '<a href="/"><span class="dim"><<</span> BACK TO COSMIC VOYAGE</a>'
|
||||
const error = 'Message not found. Please try again.'
|
||||
const content = back + '\n\n' + error
|
||||
res.status(404)
|
||||
const fullUrl = 'https://cosmic.voyage' + req.originalUrl
|
||||
res.render('basic', { content: content, canonical: fullUrl})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
error = true
|
||||
|
|
Loading…
Reference in New Issue