Skip to content

Commit 5514790

Browse files
committed
fix: prerendering, static hosting, dragula, cors
account for breaking change to httpServerRef.getHttpServer() in 5.3.0
1 parent 2fd2109 commit 5514790

23 files changed

+12030
-7867
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
.DS_Store
33
.vscode
44

5-
package-lock.json
6-
75
# Built #
86
/__build__/
97
/__server_build__/

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
(The MIT License)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
'Software'), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+18-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
# Angular Universal Starter
1+
# NestJS + Angular Universal Starter
22

3-
A minimal Angular & [**Nest**](https://github.com/nestjs/nest) starter for Universal using the [Angular CLI](https://github.com/angular/angular-cli). If you're looking for the Angular Universal repo go to [angular/universal](https://github.com/angular/universal).
3+
A minimal [**Nest**](https://github.com/nestjs/nest) and Angular starter for Universal using the
4+
[Angular CLI](https://github.com/angular/angular-cli). If you're looking for the Angular Universal repo go to
5+
[angular/universal](https://github.com/angular/universal).
46

57
## Getting Started
68

79
This demo is built following the [Angular-CLI Wiki guide](https://github.com/angular/angular-cli/wiki/stories-universal-rendering)
810

9-
We're utilizing packages from the [Angular Universal @nguniversal](https://github.com/angular/universal) repo, such as [ng-module-map-ngfactory-loader](https://github.com/angular/universal/modules/module-map-ngfactory-loader) to enable Lazy Loading.
11+
We're utilizing packages from the [Angular Universal @nguniversal](https://github.com/angular/universal) repo,
12+
such as [ng-module-map-ngfactory-loader](https://github.com/angular/universal/modules/module-map-ngfactory-loader)
13+
to enable Lazy Loading.
1014

1115
---
1216

@@ -24,20 +28,21 @@ This repo demonstrates the use of 2 different forms of Server Side Rendering.
2428
---
2529

2630
### Installation
27-
* `npm install` or `yarn`
31+
* `npm i`
2832

2933
### Development (Client-side only rendering)
30-
* run `npm run start` which will start `ng serve`
34+
* `npm start` which will run `ng serve`.
3135

3236
### Production (also for testing SSR/Pre-rendering locally)
33-
**`npm run build:ssr && npm run serve:ssr`** - Compiles your application and spins up a Node Express to serve your Universal application on `http://localhost:4000`.
34-
35-
**`npm run build:prerender && npm run serve:prerender`** - Compiles your application and prerenders your applications files, spinning up a demo http-server so you can view it on `http://localhost:8080`
36-
**Note**: To deploy your static site to a static hosting platform you will have to deploy the `dist/browser` folder, rather than the usual `dist`
37-
38-
39-
## Universal "Gotchas"
40-
Moved to [/angular/universal/blob/master/docs/gotchas.md](https://github.com/angular/universal/blob/master/docs/gotchas.md)
37+
*`npm run build:ssr && npm run serve:ssr`
38+
- Compiles your application and spins up a Node Express to serve
39+
your Universal application on `http://localhost:4000`.
40+
41+
*`npm run build:prerender && npm run serve:prerender`
42+
- Compiles your application and prerenders your
43+
applications files, spinning up a demo http-server so you can view it on `http://localhost:8080`
44+
- **Note**: To deploy your static site to a static hosting platform you will have to deploy the `dist/browser`
45+
folder, rather than the usual `dist`
4146

4247
# License
4348
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](/LICENSE)

angular.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": 1,
44
"newProjectRoot": "projects",
55
"projects": {
6-
"ng-universal-demo": {
6+
"nest-nguniversal-demo": {
77
"root": "",
88
"projectType": "application",
99
"architect": {
@@ -55,18 +55,18 @@
5555
"serve": {
5656
"builder": "@angular-devkit/build-angular:dev-server",
5757
"options": {
58-
"browserTarget": "ng-universal-demo:build"
58+
"browserTarget": "nest-nguniversal-demo:build"
5959
},
6060
"configurations": {
6161
"production": {
62-
"browserTarget": "ng-universal-demo:build:production"
62+
"browserTarget": "nest-nguniversal-demo:build:production"
6363
}
6464
}
6565
},
6666
"extract-i18n": {
6767
"builder": "@angular-devkit/build-angular:extract-i18n",
6868
"options": {
69-
"browserTarget": "ng-universal-demo:build"
69+
"browserTarget": "nest-nguniversal-demo:build"
7070
}
7171
},
7272
"test": {
@@ -125,7 +125,7 @@
125125
}
126126
}
127127
},
128-
"ng-universal-demo-e2e": {
128+
"nest-nguniversal-demo-e2e": {
129129
"root": "",
130130
"projectType": "application",
131131
"cli": {},
@@ -135,7 +135,7 @@
135135
"builder": "@angular-devkit/build-angular:protractor",
136136
"options": {
137137
"protractorConfig": "./protractor.conf.js",
138-
"devServerTarget": "ng-universal-demo:serve"
138+
"devServerTarget": "nest-nguniversal-demo:serve"
139139
}
140140
},
141141
"lint": {

0 commit comments

Comments
 (0)