0

I have one angular2 app, I can deploy it on wildfly9 and it works fine when i use hashing.

If I remove hashing its not routing properly(actually displaying 404 not found resource) though it can load the index.html. So is there any suggestion how can I deploy angular2 app without hashing on Wildfly9?

Maher
  • 2,517
  • 1
  • 19
  • 32
Swpno
  • 173
  • 1
  • 13
  • Add a servlet filter to your webapp that forwards to index.html for all GET requests other than the ones to static assets or REST API URLs. – JB Nizet Jan 22 '18 at 11:30
  • how that would help? – Swpno Jan 22 '18 at 13:50
  • 1
    It would help by solving your problem. Any request from the browser to your app would go through the filter, which would send back the index.html page. The angular application would start, inspect the path of the URL, and go to the corresponding route. https://angular.io/guide/deployment#routed-apps-must-fallback-to-indexhtml – JB Nizet Jan 22 '18 at 13:53
  • Is it possible to deploy the dist(I mean the static content) of the angular2 on apache2 without hashing?? – Swpno Feb 02 '18 at 13:41

0 Answers0