mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Merge pull request #236 from zoff-music/fix/404
Fixed 404 status not being sent
This commit is contained in:
		@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user