I have installed PWA to my Angular application by ng add @angular/pwa and followed the all necessary steps.
To run PWA locally I have installed http-server globally by npm i -g http-server
After building production by ng build --prod, I ran http-server -o from dist folder but localhost is not working and throwing invalid response.
I have tried with different ports by http-server -p 5000 but it's not working.
We need to execute "http-server -o" command from dist/ and not from dist.
Also as mentioned in https://github.com/http-party/http-server/issues/525 I had to access using http://127.0.0.1:8080/index.html instead of http://127.0.0.1:8080/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With