mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 02:02:29 +08:00
refactor(server): improve script URL rewriting
This commit is contained in:
parent
d4dbe1cb89
commit
1d675538a8
@ -32,8 +32,8 @@ async function register(app: express.Application) {
|
||||
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(/^\/src/, "");
|
||||
url = `/${assetPath}/app/src${url}`;
|
||||
url = url.replace(/.js$/, ".ts");
|
||||
console.log(`${req.url} => ${publicUrl}${url}`);
|
||||
return url;
|
||||
|
Loading…
x
Reference in New Issue
Block a user