mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2026-04-28 11:17:38 +02:00
Reduced logging output
This commit is contained in:
@@ -65,20 +65,11 @@ try {
|
||||
var newMessages = "";
|
||||
|
||||
app.set('view engine', 'ejs');
|
||||
app.use(function(req, res, next) {
|
||||
var ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress;
|
||||
if (req.headers['cf-connecting-ip']) {
|
||||
next();
|
||||
} else {
|
||||
res.status(404);
|
||||
res.end();
|
||||
logger.Log("[BLOCK]: " + req.connection.remoteAddress + " blocked, " + req.url, logger.GetColor("redbg"));
|
||||
}
|
||||
});
|
||||
app.use(function(req, res, next) {
|
||||
res.on('finish', function() {
|
||||
if (res.statusCode != 404 && req.connection.remoteAddress != "::1")
|
||||
Log(req);
|
||||
if (res.statusCode != 404 && req.connection.remoteAddress != "::1"){
|
||||
// Log(req);
|
||||
}
|
||||
else
|
||||
Log(req, true);
|
||||
});
|
||||
@@ -124,7 +115,6 @@ app.get('/static', function(req, res) {
|
||||
});
|
||||
|
||||
app.post('/postquestions', function(req, res) {
|
||||
//res.redirect('back');
|
||||
var log = "Questions posted! ";
|
||||
if (req.body.data_field == undefined) {
|
||||
res.render('submitted', {
|
||||
@@ -231,10 +221,12 @@ app.get('/sanityCheck', function(req, res) {
|
||||
|
||||
app.get('/scriptgit', function(req, res) {
|
||||
res.redirect("https://gitlab.com/YourFriendlyNeighborhoodDealer/moodle-test-userscript");
|
||||
res.end();
|
||||
});
|
||||
|
||||
app.get('/servergit', function(req, res) {
|
||||
res.redirect("https://gitlab.com/YourFriendlyNeighborhoodDealer/question-node-server");
|
||||
res.end();
|
||||
});
|
||||
|
||||
app.get('*', function(req, res) {
|
||||
|
||||
Reference in New Issue
Block a user