mirror of https://github.com/status-im/codimd.git
Updated app.js to move static file routes before use sessions which no need to have session and may gain performance
This commit is contained in:
parent
b221d4ba79
commit
74793b516a
10
app.js
10
app.js
|
@ -89,6 +89,11 @@ app.use(helmet.hsts({
|
||||||
preload: true
|
preload: true
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// routes without sessions
|
||||||
|
// static files
|
||||||
|
app.use('/', express.static(__dirname + '/public', { maxAge: config.staticcachetime }));
|
||||||
|
app.use('/vendor/', express.static(__dirname + '/bower_components', { maxAge: config.staticcachetime }));
|
||||||
|
|
||||||
//session
|
//session
|
||||||
app.use(session({
|
app.use(session({
|
||||||
name: config.sessionname,
|
name: config.sessionname,
|
||||||
|
@ -145,10 +150,7 @@ passport.deserializeUser(function (id, done) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//routes
|
// routes need sessions
|
||||||
//static files
|
|
||||||
app.use('/', express.static(__dirname + '/public'));
|
|
||||||
app.use('/vendor/', express.static(__dirname + '/bower_components'));
|
|
||||||
//template files
|
//template files
|
||||||
app.set('views', __dirname + '/public');
|
app.set('views', __dirname + '/public');
|
||||||
//set render engine
|
//set render engine
|
||||||
|
|
Loading…
Reference in New Issue