mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Reduced logging output
This commit is contained in:
parent
9ae7930141
commit
d6edfa15e1
2 changed files with 72 additions and 13 deletions
18
server.js
18
server.js
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue