Commit b21e8112 authored by yPhil's avatar yPhil
Browse files

Only logging requests to "/" OK

parent c2112c7f
......@@ -4,8 +4,7 @@ const express = require('express'),
fs = require('fs'),
pjson = require('./package.json'),
bodyParser = require('body-parser'),
app = express(),
morgan = require('morgan');
app = express();
if (!fs.existsSync(path.join(__dirname, pjson.FAVICONS_CACHE_DIR))){
fs.mkdirSync(path.join(__dirname, pjson.FAVICONS_CACHE_DIR));
......@@ -19,8 +18,6 @@ app.use('/favicons', express.static(path.join(__dirname, pjson.FAVICONS_CACHE_DI
app.use('/static', express.static(path.join(__dirname, 'public')));
app.use('/bower', express.static(path.join(__dirname, 'bower_components')));
app.use(morgan('combined'));
app.use('/', index);
app.use(bodyParser.json());
......
......@@ -10,7 +10,8 @@ const express = require('express'),
crypto = require('crypto'),
pjson = require('../package.json'),
Iconv = require('iconv').Iconv,
zlib = require('zlib');
zlib = require('zlib'),
morgan = require('morgan');
require('events').EventEmitter.defaultMaxListeners = 15;
......@@ -33,18 +34,6 @@ function escape(s) {
}
}
router.get('/', function(req, res) {
res.render('index', {
queryString: escape(req.query.add),
version: pjson.version
});
});
router.get('/about/javascript', function(req, res) {
res.render('javascript');
});
function maybeDecompress (res, encoding) {
var decompress;
if (encoding.match(/\bdeflate\b/)) {
......@@ -206,4 +195,17 @@ router.get('/discover', function(req, res) {
});
});
router.get('/about/javascript', function(req, res) {
res.render('javascript');
});
router.use(morgan('combined'));
router.get('/', function(req, res) {
res.render('index', {
queryString: escape(req.query.add),
version: pjson.version
});
});
module.exports = router;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment