Changes to SSR

This commit is contained in:
ItzMineyy committed 2024-12-25 17:01:04 +01:00
1 parent 06ab3b06bd
commit 8ccee4a70f
7 files changed
+20 -9

No files matched your search

+7
View File
@@ -24,6 +24,7 @@
"@types/three": "^0.171.0",
"express": "^4.18.2",
"ngx-device-detector": "^9.0.0",
"ngx-meta": "^0.0.1",
"react": "^19.0.0",
"rxjs": "~7.8.0",
"three": "^0.171.0",
@@ -10681,6 +10682,12 @@
"@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": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz",
+1
View File
@@ -27,6 +27,7 @@
"@types/three": "^0.171.0",
"express": "^4.18.2",
"ngx-device-detector": "^9.0.0",
"ngx-meta": "^0.0.1",
"react": "^19.0.0",
"rxjs": "~7.8.0",
"three": "^0.171.0",
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 311 KiB

+7
View File
@@ -40,6 +40,13 @@ export class AppComponent implements OnInit {
)
.subscribe(data => {
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);
});
}
+3 -3
View File
@@ -12,7 +12,7 @@ export const routes: Routes = [
data: {
meta: {
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',
url: 'https://itzminey.dev/about'
}
@@ -24,7 +24,7 @@ export const routes: Routes = [
data: {
meta: {
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',
url: 'https://itzminey.dev/about'
}
@@ -48,7 +48,7 @@ export const routes: Routes = [
data: {
meta: {
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',
url: 'https://itzminey.dev/blog'
}
-1
View File
@@ -1,7 +1,6 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
import { config } from './app/app.config.server';
import { platformServer } from '@angular/platform-server';
const bootstrap = () => bootstrapApplication(AppComponent, config);
+2 -5
View File
@@ -41,11 +41,8 @@ app.use(
* Handle all other requests by rendering the Angular application.
*/
app.use('/**', (req, res, next) => {
angularApp
.handle(req)
.then((response) =>
response ? writeResponseToNodeResponse(response, res) : next(),
)
angularApp.handle(req)
.then(response => response ? res.send(response) : next())
.catch(next);
});