How to set base url for Angular application

Jeroen Kransen picture Jeroen Kransen · Apr 16, 2019 · Viewed 12.7k times · Source

I have an Angular application as generated by JHipster. By default, it runs on the root / url, and redirects to /#/. Is there a way to override it to something else?

edit

Sorry, I have to rephrase my question, as it is misinterpreted in all answers below. I want to land my JHipster generated Angular application on something other than /, eg /crud/. The purpose is to serve some non-Angular content on /. How can I move the entire application from / to /crud/? And still have / served by a static index.html file?

Answer

qwerty picture qwerty · Apr 16, 2019

Better to do it when you build project. Like this:

ng build --prod --base-href=/test/