mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
fix(server): proxying of inner client modules
This commit is contained in:
@@ -29,7 +29,16 @@ async function register(app: express.Application) {
|
||||
throw new Error("Missing TRILIUM_PUBLIC_SERVER");
|
||||
}
|
||||
|
||||
const clientProxy = proxy(publicUrl);
|
||||
const clientProxy = proxy(publicUrl, {
|
||||
proxyReqPathResolver: (req) => {
|
||||
let url = req.url;
|
||||
url = url.replace(/^\/src/, "/");
|
||||
url = "/assets/v0.94.0/app/src" + url;
|
||||
url = url.replace(/.js$/, ".ts");
|
||||
console.log(`${req.url} => ${publicUrl}${url}`);
|
||||
return url;
|
||||
}
|
||||
});
|
||||
app.use(`/${assetPath}/app/doc_notes`, persistentCacheStatic(path.join(srcRoot, "assets", "doc_notes")));
|
||||
app.use(`/${assetPath}/app`, clientProxy);
|
||||
app.use(`/${assetPath}/app-dist`, clientProxy);
|
||||
|
||||
Reference in New Issue
Block a user