Changes to SSR
This commit is contained in:
1 parent
06ab3b06bd
commit
8ccee4a70f
7 files changed
+21
-10
No files matched your search
Generated
+7
@@ -24,6 +24,7 @@
|
|||||||
"@types/three": "^0.171.0",
|
"@types/three": "^0.171.0",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"ngx-device-detector": "^9.0.0",
|
"ngx-device-detector": "^9.0.0",
|
||||||
|
"ngx-meta": "^0.0.1",
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.0",
|
||||||
"three": "^0.171.0",
|
"three": "^0.171.0",
|
||||||
@@ -10681,6 +10682,12 @@
|
|||||||
"@angular/core": "^19.0.0"
|
"@angular/core": "^19.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ngx-meta": {
|
||||||
|
"version": "0.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ngx-meta/-/ngx-meta-0.0.1.tgz",
|
||||||
|
"integrity": "sha512-6KAvNyzr3uRt6qDErzzE/8Tw5dFYLD2QmBzE0eMril4ZlHRy1Fgbi/WzOVSl2sLr3JqXa6w3fD6wMnPPblndtw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/node-addon-api": {
|
"node_modules/node-addon-api": {
|
||||||
"version": "6.1.0",
|
"version": "6.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz",
|
||||||
|
|||||||
+2
-1
@@ -27,6 +27,7 @@
|
|||||||
"@types/three": "^0.171.0",
|
"@types/three": "^0.171.0",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"ngx-device-detector": "^9.0.0",
|
"ngx-device-detector": "^9.0.0",
|
||||||
|
"ngx-meta": "^0.0.1",
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.0",
|
||||||
"three": "^0.171.0",
|
"three": "^0.171.0",
|
||||||
@@ -49,4 +50,4 @@
|
|||||||
"karma-jasmine-html-reporter": "~2.1.0",
|
"karma-jasmine-html-reporter": "~2.1.0",
|
||||||
"typescript": "~5.6.2"
|
"typescript": "~5.6.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 311 KiB |
@@ -40,6 +40,13 @@ export class AppComponent implements OnInit {
|
|||||||
)
|
)
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
const meta = data['meta'] || {};
|
const meta = data['meta'] || {};
|
||||||
|
if (this.router.url === '/') {
|
||||||
|
// Add specific fallback meta for root route
|
||||||
|
meta.title = meta.title || 'itzMiney\'s Home';
|
||||||
|
meta.description = meta.description || 'Welcome to itzMiney\'s Homepage! Here you can find my portfolio and other cool stuff.';
|
||||||
|
meta.image = meta.image || 'https://itzminey.dev/assets/ogimg.png';
|
||||||
|
meta.url = meta.url || 'https://itzminey.dev';
|
||||||
|
}
|
||||||
this.updateMetaTags(meta);
|
this.updateMetaTags(meta);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'itzMiney\'s Home',
|
title: 'itzMiney\'s Home',
|
||||||
description: 'Welcome to itzMiney\'s Homepage! \bHere you can find my portfolio and other cool stuff.',
|
description: 'Welcome to itzMiney\'s Homepage! Here you can find my portfolio and other cool stuff.',
|
||||||
image: 'https://itzminey.dev/assets/ogimg.png',
|
image: 'https://itzminey.dev/assets/ogimg.png',
|
||||||
url: 'https://itzminey.dev/about'
|
url: 'https://itzminey.dev/about'
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'itzMiney\'s Home',
|
title: 'itzMiney\'s Home',
|
||||||
description: 'Welcome to itzMiney\'s Homepage! \bHere you can find my portfolio and other cool stuff.',
|
description: 'Welcome to itzMiney\'s Homepage! Here you can find my portfolio and other cool stuff.',
|
||||||
image: 'https://itzminey.dev/assets/ogimg.png',
|
image: 'https://itzminey.dev/assets/ogimg.png',
|
||||||
url: 'https://itzminey.dev/about'
|
url: 'https://itzminey.dev/about'
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ export const routes: Routes = [
|
|||||||
data: {
|
data: {
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Blog | itzMiney',
|
title: 'Blog | itzMiney',
|
||||||
description: 'Welcome to my blog! \bI\'ll post occasional updates here on the stuff I\'m currently up to.',
|
description: 'Welcome to my blog! I\'ll post occasional updates here on the stuff I\'m currently up to.',
|
||||||
image: 'https://itzminey.dev/assets/ogimg.png',
|
image: 'https://itzminey.dev/assets/ogimg.png',
|
||||||
url: 'https://itzminey.dev/blog'
|
url: 'https://itzminey.dev/blog'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { bootstrapApplication } from '@angular/platform-browser';
|
import { bootstrapApplication } from '@angular/platform-browser';
|
||||||
import { AppComponent } from './app/app.component';
|
import { AppComponent } from './app/app.component';
|
||||||
import { config } from './app/app.config.server';
|
import { config } from './app/app.config.server';
|
||||||
import { platformServer } from '@angular/platform-server';
|
|
||||||
|
|
||||||
const bootstrap = () => bootstrapApplication(AppComponent, config);
|
const bootstrap = () => bootstrapApplication(AppComponent, config);
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -41,11 +41,8 @@ app.use(
|
|||||||
* Handle all other requests by rendering the Angular application.
|
* Handle all other requests by rendering the Angular application.
|
||||||
*/
|
*/
|
||||||
app.use('/**', (req, res, next) => {
|
app.use('/**', (req, res, next) => {
|
||||||
angularApp
|
angularApp.handle(req)
|
||||||
.handle(req)
|
.then(response => response ? res.send(response) : next())
|
||||||
.then((response) =>
|
|
||||||
response ? writeResponseToNodeResponse(response, res) : next(),
|
|
||||||
)
|
|
||||||
.catch(next);
|
.catch(next);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user