I have an Angular application which starts on port 4300 with this configuration:
"scripts": {
"ng": "ng",
"start": "ng serve --port 4300 --host 0.0.0.0 --proxy-config proxy.conf.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
}
The app is reachable to the url:
http://localhost:4300/#/index.html
I want to serve it on a context-root, like: "/myApp/"
The application has to start always with npm start
, and I want to reach the url:
http://localhost:4300/myApp/#/index.html
How can I do it?
Everything I tried doesn't work:
- setting
<base href="/myApp/">
doesn't work - setting
"build": "ng build --prod --base-href=myApp"
doesn't work
Any help will be appreciated.