We run our angular application in IIS as a virtual application "myapplication"
In our angular app I have set in index.html:
<base href="/myapplication/">
It is working in IIS fine. However now NG serve does not work. As it can't find all the bundles under http://localhost/myapplication/ because the CLI isn't running under that path.
I have tried
ng serve --base-href /myapplication/
and browse to http://localhost:4200/myapplication/
I still see the same errors.
How do I tell the CLI to serve the application under "http://localhost:4200/myapplication/"?
Change the base href to just this:
<base href="/">
That sets the default for development time.
Then when you build for production, use:
ng serve --base-href /myapplication/
That will set it correctly when it builds the files for deployment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With