YETI
GithubDemo
1.0.0
1.0.0
  • YETI
  • Features
  • Getting Started
    • Why
    • Installation
    • Project Layout
    • NX commands
    • Playbook
    • NestJS Playbook
    • Scaffolding
  • Concepts
    • Introduction
    • Monorepo
    • DDD
    • Clean Architecture
  • Advanced
    • Content Management
    • Protobuf Tools
    • Protoc
    • Envoy
    • Style Guild
    • Angular Universal
    • Firebase
  • Modules
    • Apps
      • WebApp
      • Api
    • Libs
      • Admin
      • Blog
      • Core
      • Dashboard
      • Gen
      • Home
      • Not Found
      • Shared
  • GitOps
    • Build
    • Code Quality
    • API Docs
    • Release
    • CICD
  • DevOps
    • Database
    • Kubernetes
    • Deploy
  • Recipes
    • Authentication
    • Caching
    • Component Events from NGXS
    • Debouncing Actions
    • Dynamic Plugins
    • Immutability Helpers
    • Style Guide
    • Unit Testing
  • Community
    • Resources
    • Contributors
    • Contributing
  • FAQ
    • Yeti
    • Angular
    • GitBook
    • Awesome Links
  • Change Log
Powered by GitBook
On this page
  • Setup
  • Reference

Was this helpful?

  1. Advanced

Angular Universal

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

Setup

ng add @nguniversal/express-engine --clientProject webapp
# For a LIVE-reloading Node & browser dev-server:
ng run webapp:serve-ssr

yarn build:ssr && yarn serve:ssr

# Automatically generate static pre-rendering:
ng run webapp:prerender
ng run webapp:prerender --routes "/blog/1" --routes "/blog/2"
ng run webapp:prerender --routesFile routes.txt

Deploy

ng add @angular/fire
ng run webapp:prerender
ng deploy
ng deploy --preview #  preview your application locally before continuing with the deploy
# Everything should work fine.

Reference

PreviousStyle GuildNextFirebase

Last updated 4 years ago

Was this helpful?

https://angular.io/guide/universal
https://trilon.io/blog/angular-universal-v9-whats-new
https://github.com/TrilonIO/angular-universal-v9
https://www.ganatan.com/tutorials/server-side-rendering-with-angular-universal