mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	fix(server): some assets not served properly
This commit is contained in:
		| @@ -42,21 +42,20 @@ async function register(app: express.Application) { | |||||||
|                 return url; |                 return url; | ||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|  |         function buildAssetProxy(name: string) { | ||||||
|  |             return proxy(publicUrl!, { | ||||||
|  |                 proxyReqPathResolver: (req) => `/${assetPath}/app/src/${name}/${req.url}` | ||||||
|  |             }); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         app.use(`/${assetPath}/app/doc_notes`, persistentCacheStatic(path.join(srcRoot, "assets", "doc_notes"))); |         app.use(`/${assetPath}/app/doc_notes`, persistentCacheStatic(path.join(srcRoot, "assets", "doc_notes"))); | ||||||
|         app.use(`/${assetPath}/app`, clientProxy); |         app.use(`/${assetPath}/app`, clientProxy); | ||||||
|         app.use(`/${assetPath}/app-dist`, clientProxy); |         app.use(`/${assetPath}/app-dist`, clientProxy); | ||||||
|         app.use(`/${assetPath}/stylesheets`, proxy(publicUrl, { |         app.use(`/${assetPath}/stylesheets`, buildAssetProxy("stylesheets")); | ||||||
|             proxyReqPathResolver: (req) => `/${assetPath}/app/src/stylesheets/${req.url}` |         app.use(`/${assetPath}/libraries`, buildAssetProxy("libraries")); | ||||||
|         })); |         app.use(`/${assetPath}/fonts`, buildAssetProxy("fonts")); | ||||||
|         app.use(`/${assetPath}/libraries`, proxy(publicUrl, { |         app.use(`/${assetPath}/translations`, buildAssetProxy("translations")); | ||||||
|             proxyReqPathResolver: (req) => "/libraries" + req.url |  | ||||||
|         })); |  | ||||||
|         app.use(`/${assetPath}/fonts`, proxy(publicUrl, { |  | ||||||
|             proxyReqPathResolver: (req) => "/fonts" + req.url |  | ||||||
|         })); |  | ||||||
|         app.use(`/${assetPath}/translations`, proxy(publicUrl, { |  | ||||||
|             proxyReqPathResolver: (req) => "/translations" + req.url |  | ||||||
|         })); |  | ||||||
|         app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(srcRoot, "assets", "images"))); |         app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(srcRoot, "assets", "images"))); | ||||||
|     } else { |     } else { | ||||||
|         const clientStaticCache = persistentCacheStatic(path.join(resourceDir, "public")); |         const clientStaticCache = persistentCacheStatic(path.join(resourceDir, "public")); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user