Using the Angular CLI:
$ ng add @nestjs/ng-universal
$ npm i --save @nestjs/ng-universal
See full example here.
AngularUniversalModule in your Nest application.
forRoot() method takes an options object with a few useful properties.
||string||The directory where the module should look for client bundle (Angular app)|
||Object||Bundle file (webpack output with
||string?||Path to index file (default:
||string?||Static files root directory (default:
||string?||Path to render Angular app (default:
||StaticProvider?||The platform level providers for the current render request|
Request and Response Providers
This tool uses
@nguniversal/express-engine and will properly provide access to the Express Request and Response objects in you Angular components.
This is useful for things like setting the response code to 404 when your Angular router can't find a page (i.e.
path: '**' in routing):
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
Stay in touch
Nest is MIT licensed.