0
votes

I'm working on a Angular app where I need to integrate pwa for desktop. My app already consist of push notification with fcm and I found this library Service worker which is used for pwa as well. My application has several modules in it for which there is a corresponding server side module that interact with through the API calls. Can I use direct server url in my project in start url in manifest file? I tried with my local setup but I got below error enter image description here

My project angular.json file structure follows

enter image description here

Fromm root -> src -> I have

  • index.html
  • sw-app.js
  • sw.js

In sw-app.js

enter image description here

In sw.js

enter image description here

In index.html I added

  <script type="text/javascript" src="sw-app.js"></script>

In console of service worker

enter image description here In manifest file

enter image description here

Why I got bad http response code with 404?.. Please help me out

1

1 Answers

0
votes

Here we should also load sw.js file in angular.json file. This resolved my problem.