Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set base url for Angular application

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?

like image 559
Jeroen Kransen Avatar asked Apr 16 '19 10:04

Jeroen Kransen


1 Answers

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

ng build --prod --base-href=/test/
like image 171
qwerty Avatar answered Sep 18 '22 11:09

qwerty