0

We have an angularjs app that is served with nodejs and have workbox for serviceworker. Everything works fine with hashed version even offline (when killing the node express). Lets say we have this url

http://localhost:3000/#/form/1

and when its offline or node isnt running, it still loads the page because it is cached by serviceworker.

We decided not to use hash anymore and switch to html5 mode, now instead of hashed url we now have this

http://localhost:3000/form/1

This url wont work if directly browsed or reloaded and only works if clicked from the root

http://localhost:3000

Is this an AngularJS issue? Workbox? or this is an expected behaviour? Thanks

** UPDATE ** This is different from AngularJS routing 404 error with HTML5 mode we already solved this with express:

app.get('*', function(req, res, next) { res.sendfile('./server/public/index.html');

The error is when its offline.

djiordhan
  • 11
  • 6

0 Answers0