Merge pull request #236 from zoff-music/fix/404

Fixed 404 status not being sent
This commit is contained in:
Kasper Rynning-Tønnesen
2017-11-14 12:43:28 +01:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -130,7 +130,8 @@ app.use('/', router);
app.use('/assets', express.static(publicPath + '/assets'));
app.use(function (req, res, next) {
res.status(404).redirect("/404");
res.status(404);
res.redirect("/404");
})
db.on('error',function(err) {

View File

@@ -70,10 +70,15 @@ function channel(req, res, next) {
res.sendFile(path.join(pathThumbnails, '/public/assets/html/callback.html'));
} else {
var data = {
title: "404: File Not Found",
list_name: capitalizeFirstLetter(req.params.channel_name),
year: 2017,
javascript_file: "main.min.js"
}
if(req.params.channel_name == "404") {
res.status(404);
}
res.render('layouts/channel', data);
}
}