Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ng serve" dosn't support --bh parameter #2294

kpociecha opened this issue Sep 22, 2016 · 5 comments

"ng serve" dosn't support --bh parameter #2294

kpociecha opened this issue Sep 22, 2016 · 5 comments


Copy link

@kpociecha kpociecha commented Sep 22, 2016

I can set base href when building "ng build --prod --bh /ui/" but I can't do that when running development server with "ng serve". It would be nice to some way to set it up easily.

Copy link

@dzonatan dzonatan commented Sep 26, 2016

Why you need that? Just make it opposite: use default "/" for development and "/ui/" for production.

Copy link

@kpociecha kpociecha commented Sep 26, 2016

I am using "ng serve" for development (base href: "/", and mocked back-end)
and to quickly test it with real back-end and for that i need to have base href set to "/ui/" (all our services are behind proxy).

Copy link

@filipesilva filipesilva commented Oct 5, 2016

ng serve doesn't support base href, and we're not looking at supporting it at the moment.

@filipesilva filipesilva closed this Oct 5, 2016
Copy link

@angel-vladov angel-vladov commented Jan 23, 2017

@kpociecha I managed to run serve with base href using a proxy. It's not perfect but will do the job for the time being.

If the base href I need is project then:

ng serve --proxy-config proxy.conf.json --live-reload-base-url /project/

And in proxy.cong.json:

    "context": [
    "target": {
      "host": "localhost",
      "protocol": "http:",
      "port": 4200
    "secure": false,
    "pathRewrite": {
      "^/project": "/"

In index.html (we need to set this manually because --bh won't work with ng serve):
<base href="/editor/">

Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Sep 6, 2019

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants