Skip to content

Commit

Permalink
docs: removing http-server section in Service worker tour (angular#47613
Browse files Browse the repository at this point in the history
)

- Based on issue angular#47583
- Updated docs for Service workers by removing the section which used http-server to use service workers with ng serve
- By changelog of v14.2.0, service workers become compatible with ng serve using feature angular#23679

PR Close angular#47613
  • Loading branch information
vyom1611 authored and nouraellm committed Nov 6, 2022
1 parent f89cae5 commit 212d488
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions aio/content/guide/service-worker-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,6 @@ The CLI project is now set up to use the Angular service worker.
This section demonstrates a service worker in action,
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.
Use any HTTP server.
The following example 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 the directory containing your web files with `http-server`, run the following command:

<code-example format="shell" language="shell">

http-server -p 8080 -c-1 dist/&lt;project-name&gt;

</code-example>

### Initial load

With the server running, point your browser at `http://localhost:8080`.
Expand Down

0 comments on commit 212d488

Please sign in to comment.