Fixes #491 adds support for a configurable cache-control max-age setting for serving static assets, with a default of 1d on production and 0 elsewhere (#492)
This commit is contained in:
parent
82ca755362
commit
aadd533061
1 changed files with 3 additions and 1 deletions
|
@ -57,7 +57,9 @@ app.options('*', corsMiddleware);
|
||||||
|
|
||||||
// Body parser, cookie parser, sessions, serve public assets
|
// Body parser, cookie parser, sessions, serve public assets
|
||||||
|
|
||||||
app.use(Express.static(path.resolve(__dirname, '../static')));
|
app.use(Express.static(path.resolve(__dirname, '../static'), {
|
||||||
|
maxAge: process.env.STATIC_MAX_AGE || (process.env.NODE_ENV === 'production' ? '1d' : '0')
|
||||||
|
}));
|
||||||
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
|
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
|
||||||
app.use(bodyParser.json({ limit: '50mb' }));
|
app.use(bodyParser.json({ limit: '50mb' }));
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
|
|
Loading…
Reference in a new issue