There are various ways we can add Universal support to our application. But one of the best ways is mentioned in the Angular documentation, in the Angular Universal guide (https://angular.io/guide/universal): we can use the ng add command, along with @nguniversal/express-engine and clientProject, to add Universal support to our project:
> ng add @nguniversal/express-engine --clientProject personal-blog
This command adds all the required dependencies to the package.json file and installs them. It also creates all the different files, along with code changes. The following files are created and updated:
CREATE src/main.server.ts (220 bytes)
CREATE src/app/app.server.module.ts (427 bytes)
CREATE src/tsconfig.server.json (219 bytes)
CREATE webpack.server.config.js (1360 bytes)
CREATE server.ts (1472 bytes)
UPDATE package.json (2013 bytes)
UPDATE angular...