mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added a funny 404 page
This commit is contained in:
@@ -55,7 +55,9 @@ function list(msg, guid, coll, offline, socket) {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
db.createCollection(coll, function(err, docs){
|
db.createCollection(coll, function(err, docs){
|
||||||
db.collection(coll).insert({"addsongs":false, "adminpass":"", "allvideos":true, "frontpage":true, "longsongs":false, "removeplay": false, "shuffle": true, "skip": false, "skips": [], "startTime":Functions.get_time(), "views": [], "vote": false, "desc": ""}, function(err, docs){
|
var configs = {"addsongs":false, "adminpass":"", "allvideos":true, "frontpage":true, "longsongs":false, "removeplay": false, "shuffle": true, "skip": false, "skips": [], "startTime":Functions.get_time(), "views": [], "vote": false, "desc": ""};
|
||||||
|
db.collection(coll).insert(configs, function(err, docs){
|
||||||
|
socket.join(coll);
|
||||||
List.send_list(coll, socket, true, false, true);
|
List.send_list(coll, socket, true, false, true);
|
||||||
db.collection("frontpage_lists").insert({"_id": coll, "count" : 0, "frontpage": true, "accessed": Functions.get_time()});
|
db.collection("frontpage_lists").insert({"_id": coll, "count" : 0, "frontpage": true, "accessed": Functions.get_time()});
|
||||||
});
|
});
|
||||||
@@ -361,7 +363,6 @@ function send_list(coll, socket, send, list_send, configs, shuffled)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if(configs)
|
if(configs)
|
||||||
{
|
{
|
||||||
if(conf[0].adminpass !== "") conf[0].adminpass = true;
|
if(conf[0].adminpass !== "") conf[0].adminpass = true;
|
||||||
|
|||||||
@@ -129,6 +129,10 @@ app.use('/', router);
|
|||||||
|
|
||||||
app.use('/assets', express.static(publicPath + '/assets'));
|
app.use('/assets', express.static(publicPath + '/assets'));
|
||||||
|
|
||||||
|
app.use(function (req, res, next) {
|
||||||
|
res.status(404).redirect("/404");
|
||||||
|
})
|
||||||
|
|
||||||
db.on('error',function(err) {
|
db.on('error',function(err) {
|
||||||
console.log("\n" + new Date().toString() + "\n Database error: ", err);
|
console.log("\n" + new Date().toString() + "\n Database error: ", err);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,8 +25,9 @@ router.route('/api/list/:channel_name').get(function(req, res) {
|
|||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.send(JSON.stringify(docs));
|
res.send(JSON.stringify(docs));
|
||||||
} else {
|
} else {
|
||||||
res.status(404);
|
/*res.status(404);
|
||||||
res.send(404);
|
res.send(404);*/
|
||||||
|
res.status(404).redirect("/404");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -62,8 +63,9 @@ router.route('/api/conf/:channel_name').get(function(req, res) {
|
|||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.send(JSON.stringify(conf));
|
res.send(JSON.stringify(conf));
|
||||||
} else {
|
} else {
|
||||||
res.status(404);
|
/*res.status(404);
|
||||||
res.send(404);
|
res.send(404);*/
|
||||||
|
res.status(404).redirect("/404");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user