[DURACOM-288] Refactoring configuration to transfer state

This commit is contained in:
Giuseppe Digilio
2025-01-09 18:46:22 +01:00
parent f9d8e4e0b7
commit cb5deb644e
9 changed files with 44 additions and 27 deletions

View File

@@ -273,10 +273,8 @@ function serverSideRender(req, res, sendToUser: boolean = true) {
}, (err, data) => {
if (hasNoValue(err) && hasValue(data)) {
// Replace REST URL with UI URL
if (environment.ui.replaceRestUrl && REST_BASE_URL !== environment.rest.baseUrl) {
const t0 = Date.now();
data = data.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
if (environment.universal.replaceRestUrl && REST_BASE_URL !== environment.rest.baseUrl) {
data = data.replace(new RegExp(REST_BASE_URL, 'g'), environment.rest.baseUrl);
}
// save server side rendered page to cache (if any are enabled)