misrouting now only shows warning when in debug mode

This commit is contained in:
Julian Lam
2013-10-04 10:37:32 -04:00
parent 01e04d60a9
commit 57465eb277

View File

@@ -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'
});