[Attempt 1] fix slow website
Some checks failed
Queue Release Build / prepare (push) Successful in 25s
Deploy Web Apps / deploy (push) Successful in 17m20s
Queue Release Build / finalize (push) Has been cancelled
Queue Release Build / build-linux (push) Has started running
Queue Release Build / build-windows (push) Has been cancelled

This commit is contained in:
2026-03-13 02:46:21 +01:00
parent 22d355a522
commit 2b6e477c9a
3 changed files with 19 additions and 13 deletions

View File

@@ -13,7 +13,16 @@ const serverDistFolder = dirname(fileURLToPath(import.meta.url));
const browserDistFolder = resolve(serverDistFolder, '../browser');
const indexHtml = join(serverDistFolder, 'index.server.html');
const app = express();
const commonEngine = new CommonEngine();
const commonEngine = new CommonEngine({
allowedHosts: [
'toju.app',
'www.toju.app',
'localhost',
'127.0.0.1'
]
});
app.set('trust proxy', 'loopback');
/**
* Proxy endpoint for Gitea releases API to avoid CORS issues.
@@ -51,7 +60,8 @@ app.get(
'**',
express.static(browserDistFolder, {
maxAge: '1y',
index: 'index.html'
index: 'index.html',
redirect: false
})
);