Hi guys,
Here is what I understand so far and I am struggling to understand the at the deployment step.
Though I actually manage to deploy it firebase and it works but I don't understand how it works. I really appreciate if you could explain this to me.
Thank you in advance!
adding Angular SSR to Angular project
$ng add @angular/ssr
package.json
Check the command
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"dev:ssr": "ng run saoakev3:serve-ssr",
"serve:ssr": "node dist/saoakev3/server/main.js",
"build:ssr": "ng build && ng run saoakev3:server",
"prerender": "ng run saoakev3:prerender"
},
Run server to check if SSR is working properly
$npm run dev:ssr
Angular generate two bundles in dist folder
dist/broswer
dist/server
HTML payload is visible at <app-root>..
Understanding how it works
commonEngine is the Angular server side engine that use server bundle that is available in dist/server to produce HTML payload
When HTTP request (based on the URL) hit, CommonEngine in Server.ts get trigger and using the information available in server bundle and application get render