only use google analyatics in production

This commit is contained in:
Tyler Renelle
2012-08-09 11:22:29 -04:00
parent 47a451b578
commit 4b28ab9235
3 changed files with 11 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
// Generated by CoffeeScript 1.3.3
var ONE_YEAR, app, derby, express, expressApp, gzippo, habitrpgMobile, http, path, publicPath, racer, root, server, serverError, store;
var ONE_YEAR, app, derby, express, expressApp, gzippo, habitrpgMiddleware, http, path, publicPath, racer, root, server, serverError, store;
http = require('http');
@@ -46,10 +46,11 @@ root = path.dirname(path.dirname(__dirname));
publicPath = path.join(root, 'public');
habitrpgMobile = function(req, res, next) {
habitrpgMiddleware = function(req, res, next) {
var model;
model = req.getModel();
model.set('_mobileDevice', /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(req.header('User-Agent')));
model.set('_nodeEnv', process.env.NODE_ENV);
return next();
};
@@ -60,7 +61,7 @@ expressApp.use(express.favicon()).use(gzippo.staticGzip(publicPath, {
cookie: {
maxAge: ONE_YEAR
}
})).use(store.modelMiddleware()).use(habitrpgMobile).use(app.router()).use(expressApp.router).use(serverError(root));
})).use(store.modelMiddleware()).use(habitrpgMiddleware).use(app.router()).use(expressApp.router).use(serverError(root));
expressApp.all('*', function(req) {
throw "404: " + req.url;