mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 16:30:34 +01:00
misrouting now only shows warning when in debug mode
This commit is contained in:
@@ -139,10 +139,11 @@ var express = require('express'),
|
||||
res.type('text/javascript').send(200, '');
|
||||
} else if (req.accepts('html')) {
|
||||
// respond with html page
|
||||
winston.warn('Route requested but not found: ' + req.url);
|
||||
if (process.env.NODE_ENV === 'development') winston.warn('Route requested but not found: ' + req.url);
|
||||
res.redirect(nconf.get('relative_path') + '/404');
|
||||
} else if (req.accepts('json')) {
|
||||
// respond with json
|
||||
if (process.env.NODE_ENV === 'development') winston.warn('Route requested but not found: ' + req.url);
|
||||
res.json({
|
||||
error: 'Not found'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user