mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 21:36:05 +01:00
use trilium version number in asset paths to avoid caching issues WIP
This commit is contained in:
18
src/app.js
18
src/app.js
@@ -10,6 +10,7 @@ const FileStore = require('session-file-store')(session);
|
||||
const sessionSecret = require('./services/session_secret');
|
||||
const dataDir = require('./services/data_dir');
|
||||
const utils = require('./services/utils');
|
||||
const assetPath = require('./services/asset_path');
|
||||
require('./services/handlers');
|
||||
require('./becca/becca_loader');
|
||||
|
||||
@@ -34,14 +35,19 @@ app.use(express.json({limit: '500mb'}));
|
||||
app.use(express.raw({limit: '500mb'}));
|
||||
app.use(express.urlencoded({extended: false}));
|
||||
app.use(cookieParser());
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
app.use('/libraries', express.static(path.join(__dirname, '..', 'libraries')));
|
||||
app.use(express.static(path.join(__dirname, 'public/root')));
|
||||
app.use(`/${assetPath}/app`, express.static(path.join(__dirname, 'public/app')));
|
||||
app.use(`/${assetPath}/app-dist`, express.static(path.join(__dirname, 'public/app-dist')));
|
||||
app.use(`/${assetPath}/fonts`, express.static(path.join(__dirname, 'public/fonts')));
|
||||
app.use(`/${assetPath}/stylesheets`, express.static(path.join(__dirname, 'public/stylesheets')));
|
||||
app.use(`/${assetPath}/libraries`, express.static(path.join(__dirname, '..', 'libraries')));
|
||||
// excalidraw-view mode in shared notes
|
||||
app.use('/node_modules/react/umd/react.production.min.js', express.static(path.join(__dirname, '..', 'node_modules/react/umd/react.production.min.js')));
|
||||
app.use('/node_modules/react-dom/umd/react-dom.production.min.js', express.static(path.join(__dirname, '..', 'node_modules/react-dom/umd/react-dom.production.min.js')));
|
||||
app.use(`/${assetPath}/node_modules/react/umd/react.production.min.js`, express.static(path.join(__dirname, '..', 'node_modules/react/umd/react.production.min.js')));
|
||||
app.use(`/${assetPath}/node_modules/react-dom/umd/react-dom.production.min.js`, express.static(path.join(__dirname, '..', 'node_modules/react-dom/umd/react-dom.production.min.js')));
|
||||
// expose whole dist folder since complete assets are needed in edit and share
|
||||
app.use('/node_modules/@excalidraw/excalidraw/dist/', express.static(path.join(__dirname, '..', 'node_modules/@excalidraw/excalidraw/dist/')));
|
||||
app.use('/images', express.static(path.join(__dirname, '..', 'images')));
|
||||
app.use(`/node_modules/@excalidraw/excalidraw/dist/`, express.static(path.join(__dirname, '..', 'node_modules/@excalidraw/excalidraw/dist/')));
|
||||
app.use(`/${assetPath}/node_modules/@excalidraw/excalidraw/dist/`, express.static(path.join(__dirname, '..', 'node_modules/@excalidraw/excalidraw/dist/')));
|
||||
app.use(`/${assetPath}/images`, express.static(path.join(__dirname, '..', 'images')));
|
||||
const sessionParser = session({
|
||||
secret: sessionSecret,
|
||||
resave: false, // true forces the session to be saved back to the session store, even if the session was never modified during the request.
|
||||
|
||||
Reference in New Issue
Block a user