This project was generated using Nx. It currently includes an Angular App with server side rendering (SSR) via Nest.
master branch -> nx workspace with two apps (angular + nest) -> Step 1. - 6.
single-app branch -> nx workspace with single app (angular) -> Step 1. - 4.
npx create-nx-workspace nx-ng-nest-universal --npm-scope=ss --style=scss
ng g app ng-test-app --prefix=ss-test --routing=true --style=scss
ng add @nestjs/ng-universal --clientProject=ng-test-app --project=ng-test-app
4. Adjustments to make everything work. (s. Commit)
1. rimraf yarn.lock && npm i (to avoid packages conflicts)
2. Fix fileReplacements for ng-test-app:server:production in angular.json
3. Edit webpack.server.config.js
✔️ Nx App + SSR working. Move on if you want to have nest as a seperated app in your workspace.
ng g node-app nest-test-app --framework=nestjs
6. Adjustments to use the freshly generated Nest App for SSR (s. Commit)
1. Mainly move and edit generated files from Step 3
2. Add @nestjs/ng-universal to nest app in workspace
✔️ Nx Workspace with seperated Nest App for SSR working.
> git clone https://github.com/servrox/nx-ng-nest-universal.git
> cd nx-ng-nest-universal\
> npm i
npm run build:ssr && npm run serve:ssr
> npm run go
or for development
> npm run serve
UI at http://localhost:4000/
API at http://localhost:4000/api
- Angular CLI - version 7.3.9
- Angular Universal - version 7.1.1
- nest - version 6.2.4
- Nx - version 7.8.6
- Marcel Mayer - servrox.solutions