Skip to content

Commit a7ec239

Browse files
authored
Update README.md
1 parent be5b076 commit a7ec239

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,35 @@ To run the frontend part of our code, we will use the Angular CLI:
6161

6262
npm start
6363

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.
6565

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
6767

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
6993

7094
This repository has multiple branches, have a look at the beginning of each section to see the name of the branch.
7195

0 commit comments

Comments
 (0)