var config = require('./environment');
var passport = require('passport');
-module.exports = function(app) {
- var env = app.get('env');
+module.exports = function (app) {
+ var env = app.get('env');
- app.set('views', config.root + '/server/views');
- app.set('view engine', 'jade');
- app.use(compression());
- app.use(bodyParser.urlencoded({ extended: false }));
- app.use(bodyParser.json());
- app.use(methodOverride());
- app.use(cookieParser());
- app.use(passport.initialize());
- if ('production' === env) {
- app.use(favicon(path.join(config.root, 'public', 'favicon.ico')));
- app.use(express.static(path.join(config.root, 'public')));
- app.set('appPath', path.join(config.root, 'public'));
- app.use(morgan('dev'));
- }
+ app.set('views', config.root + '/server/views');
+ app.set('view engine', 'jade');
+ app.use(compression());
+ app.use(bodyParser.urlencoded({extended: false}));
+ app.use(bodyParser.json());
+ app.use(methodOverride());
+ app.use(cookieParser());
+ app.use(passport.initialize());
+ if ('production' === env) {
+ app.use(favicon(path.join(config.root, 'public', 'favicon.ico')));
+ app.use(express.static(path.join(config.root, 'public')));
+ app.set('appPath', path.join(config.root, 'public'));
+ app.use(morgan('dev'));
+ }
- if ('development' === env || 'test' === env) {
- // Modif LH -> connect-livereload empêche le téléchargement de fichier PDF
- //app.use(require('connect-livereload')());
- app.use(express.static(path.join(config.root, '.tmp')));
- app.use(express.static(path.join(config.root, 'client')));
- app.set('appPath', path.join(config.root, 'client'));
- app.use(morgan('dev'));
- app.use(errorHandler()); // Error handler - has to be last
- }
+ if ('development' === env || 'test' === env) {
+ // Modif LH -> connect-livereload empêche le téléchargement de fichier PDF
+ app.use(require('connect-livereload')());
+ app.use(express.static(path.join(config.root, '.tmp')));
+ app.use(express.static(path.join(config.root, 'client')));
+ app.set('appPath', path.join(config.root, 'client'));
+ app.use(morgan('dev'));
+ app.use(errorHandler()); // Error handler - has to be last
+ }
};
\ No newline at end of file