[DURACOM-288] Refactoring configuration to transfer state

This commit is contained in:
Giuseppe Digilio
2025-01-09 18:46:22 +01:00
parent a7276b8a30
commit cfba84ce31
9 changed files with 45 additions and 26 deletions

View File

@@ -270,10 +270,8 @@ function serverSideRender(req, res, next, sendToUser: boolean = true) {
.then((html) => {
if (hasValue(html)) {
// Replace REST URL with UI URL
if (environment.ui.replaceRestUrl && REST_BASE_URL !== environment.rest.baseUrl) {
const t0 = Date.now();
if (environment.ssr.replaceRestUrl && REST_BASE_URL !== environment.rest.baseUrl) {
html = html.replace(new RegExp(REST_BASE_URL, 'g'), environment.rest.baseUrl);
console.log(`Replaced all SSR URLs in HTML in ${Date.now() - t0}ms`); // todo: remove this
}
// save server side rendered page to cache (if any are enabled)