I have an angular app which we are deploying on tomcat(using war). I am adding the offline support to the app using angular-sw. The application is accessed using the context-path(say showcase-app)
The problem which I am facing right now is that when I try to access app(offline mode using chrome dev tool) using below urls, then its working fine:
http://localhost:8080/showcase-app/
http://localhost:8080/showcase-app/index.html (redirected to http://localhost:8080/showcase-app/)
When I press F5, then I am getting http 504
If I try http://localhost:8080/showcase-app, 504 error is thrown
I feel that its something to do with the routing but not sure what exactly the problem is.
Here is my generated ngsw.json file(Remove the unnecessary css and js urls)
{
"configVersion": 1,
"timestamp": 1565693252354,
"index": "/showcase-app/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"updateMode": "prefetch",
"urls": [
"/showcase-app/favicon.ico",
"/showcase-app/index.html",
"/showcase-app/main-es2015.f5103b4162e6ae00889a.js",
"/showcase-app/main-es5.0b19cc7e5eb478145768.js",
"/showcase-app/polyfills-es2015.e35a976998ea3f8206df.js",
"/showcase-app/polyfills-es5.6e97d82e42cdf0e046a3.js",
"/showcase-app/runtime-es2015.3d53808bc2188f4243c7.js",
"/showcase-app/runtime-es5.f1b869bd6638a324a133.js",
"/showcase-app/scripts.385aa2cec8cdc651bfad.js",
"/showcase-app/styles.5b950d38f1d7a3ba6506.css",
],
"patterns": []
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"urls": [
"/showcase-app/CardObject.f4ac54620cd0f92eb623.png"
],
"patterns": []
}
],
"dataGroups": [],
"hashTable": {
"/showcase-app/CardObject.f4ac54620cd0f92eb623.png": "425c1e1cfed36bea7d7d3637fa95c147bd5480d3"
},
"navigationUrls": [
{
"positive": true,
"regex": "^\\/.*$"
},
{
"positive": false,
"regex": "^\\/(?:.+\\/)?[^/]*\\.[^/]*$"
},
{
"positive": false,
"regex": "^\\/(?:.+\\/)?[^/]*__[^/]*$"
},
{
"positive": false,
"regex": "^\\/(?:.+\\/)?[^/]*__[^/]*\\/.*$"
}
]
}
I am using Angular 8