Use es6 function for headers

This commit is contained in:
Vladimir Borisov 2023-06-08 12:59:59 +03:00
parent 361ba354cb
commit 5c17408b20
No known key found for this signature in database
GPG key ID: F9A584BE4FCB6603

View file

@ -13,7 +13,7 @@ const build_path = path.resolve(__dirname, 'build');
const index_path = path.join(build_path, 'index.html');
express().use(express.static(build_path, {
setHeaders: function(res, path) {
setHeaders: (res, path) => {
if (path === index_path) res.set('cache-control', `public, max-age: ${INDEX_CACHE}`);
else res.set('cache-control', `public, max-age: ${ASSETS_CACHE}`);
}