diff --git a/aio/content/guide/service-worker-getting-started.md b/aio/content/guide/service-worker-getting-started.md index 348a34772f..ec13baad74 100644 --- a/aio/content/guide/service-worker-getting-started.md +++ b/aio/content/guide/service-worker-getting-started.md @@ -49,13 +49,12 @@ using an example application. ### 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 -cd dist/*project-name* -http-server -p 8080 +http-server -p 8080 -c-1 dist/ ``` ### Initial load @@ -121,8 +120,7 @@ next step is understanding how updates work. ```sh ng build --prod -cd dist -http-server -p 8080 +http-server -p 8080 -c-1 dist/ ``` ### Updating your application in the browser