mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-11 11:02:27 +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, {
|
const clientProxy = proxy(publicUrl, {
|
||||||
proxyReqPathResolver: (req) => {
|
proxyReqPathResolver: (req) => {
|
||||||
let url = req.url;
|
let url = req.url;
|
||||||
url = url.replace(/^\/src/, "/");
|
url = url.replace(/^\/src/, "");
|
||||||
url = "/assets/v0.94.0/app/src" + url;
|
url = `/${assetPath}/app/src${url}`;
|
||||||
url = url.replace(/.js$/, ".ts");
|
url = url.replace(/.js$/, ".ts");
|
||||||
console.log(`${req.url} => ${publicUrl}${url}`);
|
console.log(`${req.url} => ${publicUrl}${url}`);
|
||||||
return url;
|
return url;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user