mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
only use google analyatics in production
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user