docs(service-worker): update http-server command (#25845)
PR Close #25845
This commit is contained in:
parent
694b8ae779
commit
d6cd041cbd
|
@ -49,13 +49,12 @@ using an example application.
|
||||||
|
|
||||||
### Serving with `http-server`
|
### Serving with `http-server`
|
||||||
|
|
||||||
Because `ng serve` does not work with service workers, you must use a separate HTTP server to test your project locally. You can use any HTTP server. The example below uses the [http-server](https://www.npmjs.com/package/http-server) package from npm. To reduce the possibility of conflicts, test on a dedicated port.
|
Because `ng serve` does not work with service workers, you must use a separate HTTP server to test your project locally. You can use any HTTP server. The example below uses the [http-server](https://www.npmjs.com/package/http-server) package from npm. To reduce the possibility of conflicts and avoid serving stale content, test on a dedicated port and disable caching.
|
||||||
|
|
||||||
To serve with `http-server`, change to the directory containing your web files and start the web server:
|
To serve the directory containing your web files with `http-server`, run the following command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd dist/*project-name*
|
http-server -p 8080 -c-1 dist/<project-name>
|
||||||
http-server -p 8080
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Initial load
|
### Initial load
|
||||||
|
@ -121,8 +120,7 @@ next step is understanding how updates work.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
ng build --prod
|
ng build --prod
|
||||||
cd dist
|
http-server -p 8080 -c-1 dist/<project-name>
|
||||||
http-server -p 8080
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Updating your application in the browser
|
### Updating your application in the browser
|
||||||
|
|
Loading…
Reference in New Issue