Angular Universal
Server-Side Rendering (SSR), Static-Site Generator (SSG) aka pre-rendering

Setup

1
ng add @nguniversal/express-engine --clientProject webapp
2
# For a LIVE-reloading Node & browser dev-server:
3
ng run webapp:serve-ssr
4
5
yarn build:ssr && yarn serve:ssr
6
7
# Automatically generate static pre-rendering:
8
ng run webapp:prerender
9
ng run webapp:prerender --routes "/blog/1" --routes "/blog/2"
10
ng run webapp:prerender --routesFile routes.txt
Copied!
Deploy
1
ng add @angular/fire
2
ng run webapp:prerender
3
ng deploy
4
ng deploy --preview # preview your application locally before continuing with the deploy
5
# Everything should work fine.
Copied!

Reference

Last modified 9mo ago
Copy link