My angular application is bundled and deployed together with a java application. Angular AOT build is placed in the folder WebContent/app
.
While taking the AOT build,
- If I specify
--base-href /app
, I'm getting 404 after loading the index.html. In that case, I have to add--deploy-url /app/
during my build, for the application to be working properly. - But If I specify
--base-href /app/
then scripts, styles, and other resources are served correctly. And there's no need to specify--deploy-url
What I could observe is that If I don't append "/" to base-href, the server request made is using the context-root - http://localhost:9080/application-name/styles.***.css and when I append the "/", server context-root is appended with app
- http://localhost:9080/application-name/app/styles.***.css
Why is adding "/" at the end of base-href make all this difference?
Could someone explain this behavior as I'm not able to find anything on docs?
Thanks in Advance.