You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-3Lines changed: 27 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -61,11 +61,35 @@ To run the frontend part of our code, we will use the Angular CLI:
61
61
62
62
npm start
63
63
64
-
The application is visible at port 4200, but you need to use HTTPS - [https://localhost:4200](https://localhost:4200)
64
+
The development application is visible at port 4200- [http://localhost:4200](http://localhost:4200), but in this course we will be mostly running the application production mode.
65
65
66
-
This application uses a self-signed certificate, so you will need to accept it using the browser. If you are using Chrome, you will need to click Advanced and then choose "Proceed to localhost".
66
+
# Running the application in production mode, with the service worker active
67
67
68
-
# Important
68
+
In order to build the application in production mode, we use this command:
69
+
70
+
ng build --prod
71
+
72
+
This is going to output the production application in the dist folder, with the service worker active. To run the application we will need an HTTP server, so let's install http-server:
73
+
74
+
npm install -g http-server
75
+
76
+
We can then run the production application by doing:
77
+
78
+
cd dist
79
+
http-server -c-1 .
80
+
81
+
And now the production application should be available at port 8080 - [http://localhost:8080](http://localhost:8080).
82
+
83
+
> Note: Please check in the server startup log to see what port is http-server using. By default its 8080, but it that port is busy then 8081 will used, etc.
84
+
85
+
# Shortcut command for building the application in production mode
86
+
87
+
We will be building the application often in production mode. This shortcut command will build the application in production mode and start http-server all in one go:
88
+
89
+
npm run start:prod
90
+
91
+
92
+
# Getting the code at the beginning of each section
69
93
70
94
This repository has multiple branches, have a look at the beginning of each section to see the name of the branch.
0 commit comments