mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
fixed SSR issues
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
"path": "./webpack/webpack.common.ts",
|
"path": "./webpack/webpack.common.ts",
|
||||||
"mergeStrategies": {
|
"mergeStrategies": {
|
||||||
"loaders": "prepend"
|
"loaders": "prepend"
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
"outputPath": "dist/browser",
|
"outputPath": "dist/browser",
|
||||||
"index": "src/index.html",
|
"index": "src/index.html",
|
||||||
|
@@ -78,7 +78,7 @@ function cacheControl(req, res, next) {
|
|||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
||||||
app.use('/', cacheControl, express.static('dist', { index: false }));
|
app.get('*.*', cacheControl, express.static(DIST_FOLDER, { index: false }));
|
||||||
|
|
||||||
// TODO: either remove or update mock backend
|
// TODO: either remove or update mock backend
|
||||||
// app.get('/data.json', serverApi);
|
// app.get('/data.json', serverApi);
|
||||||
@@ -107,7 +107,7 @@ function ngApp(req, res) {
|
|||||||
|
|
||||||
if (environment.universal.preboot) {
|
if (environment.universal.preboot) {
|
||||||
Zone.current.fork({ name: 'CSR fallback', onHandleError }).run(() => {
|
Zone.current.fork({ name: 'CSR fallback', onHandleError }).run(() => {
|
||||||
res.render(DIST_FOLDER, {
|
res.render(DIST_FOLDER + '/index.html', {
|
||||||
req,
|
req,
|
||||||
res,
|
res,
|
||||||
preboot: environment.universal.preboot,
|
preboot: environment.universal.preboot,
|
||||||
@@ -127,7 +127,7 @@ function ngApp(req, res) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
app.get('*.*', ngApp);
|
app.get('*', ngApp);
|
||||||
|
|
||||||
function serverStarted() {
|
function serverStarted() {
|
||||||
console.log(`[${new Date().toTimeString()}] Listening at ${environment.ui.baseUrl}`);
|
console.log(`[${new Date().toTimeString()}] Listening at ${environment.ui.baseUrl}`);
|
||||||
|
@@ -8,7 +8,7 @@ $sidebar-items-width: 250px !default;
|
|||||||
$total-sidebar-width: $collapsed-sidebar-width + $sidebar-items-width !default;
|
$total-sidebar-width: $collapsed-sidebar-width + $sidebar-items-width !default;
|
||||||
|
|
||||||
/* Fonts */
|
/* Fonts */
|
||||||
$fa-font-path: "node_modules/@fortawesome/fontawesome-free/webfonts" !default;
|
$fa-font-path: "/assets/fonts" !default;
|
||||||
/* Images */
|
/* Images */
|
||||||
$image-path: "../assets/images" !default;
|
$image-path: "../assets/images" !default;
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"extends": "./tsconfig.app.json",
|
"extends": "./tsconfig.app.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./out-tsc/app-server",
|
"outDir": "./out-tsc/app-server",
|
||||||
"module": "commonjs"
|
"module": "commonjs",
|
||||||
},
|
},
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"entryModule": "./src/modules/app/server-app.module#ServerAppModule"
|
"entryModule": "./src/modules/app/server-app.module#ServerAppModule"
|
||||||
|
Reference in New Issue
Block a user