mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Add configuration to toggle replace/transfer
This commit is contained in:

committed by
Giuseppe Digilio

parent
587e1546dc
commit
a7276b8a30
@@ -269,6 +269,13 @@ 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();
|
||||
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)
|
||||
saveToCache(req, html);
|
||||
if (sendToUser) {
|
||||
|
Reference in New Issue
Block a user