Skip to content

bellizio/angular-universal-pwa

Repository files navigation

Angular Universal PWA Starter

An Angular 5+ Universal PWA starter app.

Getting Started

Dependencies

Setup

  1. git clone https://github.com/bellizio/angular-universal-pwa.git
  2. cd angular-universal-pwa
  3. yarn install

Development

Run npm start for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Production

  1. Run npm run build:ssr to build the project for production.
  2. Run npm run serve:ssr to serve the production build.

Testing

Unit Tests

  • Run ng test to execute the unit tests via Karma.

End-to-End Tests

  • Run ng e2e to execute the end-to-end tests via Protractor.

Service Worker

By default, the production build uses a service worker generated by NGSW (Angular Service Worker).

To use a service worker generated by the Workbox CLI, do the following:

  1. In app.browser.module.ts, comment out the call to ServiceWorkerModule.register() and enable the call to registerWorkboxSW()
  2. Run npm run build:ssr
  3. Run npm run sw:workbox

Help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.