I want to deploy my spring-boot webapp with angular-frontend to a tomact-server. I build the angular app with angular-cli and the following commando
ng build --deploy-url /mywebapp/
The app works but following problems still exist:
- Each time I have to change manually the base href tag to
<base href="/mywebapp/">. Why is this not done automatically in the build process? - All paths to static ressources of the 'assets' directory must also changed manually to '/mywebapp/assets' (i.e.
<img src="/mywebapp/assets/logo.png">) - Browser refresh of router links URLs (subpaths) does not work anymore. (i.e. angular navigation to http://localhost:8080/mywebapp/feature1 works but if I want to refresh the same URL in the browser it does not work. I can only refresh the root URL http://localhost:8080/mywebapp/)
base href="."this should solve your problem #1 & #2