Home > Mobile >  Django path and routing
Django path and routing

Time:10-30

My folder structure inside the app:

pwa->static->pwa->serviceworker.js 

and

pwa->templates->indexPWA.html

How can I refer to the indexPWA.html inside the serviceworker.js?

var filesToCache = ["indexPWA.html"] doesn't work, cause it's not the right path, but what is the right one?

CodePudding user response:

You can use the path in which you address the indexPWA.html page in the browser.

Example:

       var filesToCache = ["/indexPWA.html"]

       var filesToCache = ["/"]

You can check the correct path by opening indexPWA.html in the browser and check for the words which are after 127.0.0.1:8000/ in the url bar.

  • Related