2

I tried to build and deploy angular-tou-of-heroes application to github, but always got duplicate app name in the path. Could anybody help me with this issue?

My build command is ng build --prod --output-path docs --base-href angular-tour-of-heroes I deployed from Github /doc directory. When click the link, it keep redirect to the flowing path, which has two tour-of-heroes in it https://frankxiao008.github.io/angular-tour-of-heroes/angular-tour-of-heroes/

Here is my Github repository link for my code. https://github.com/frankxiao008/angular-tour-of-heroes

I followed this instruction enter image description here

Frank Xiao
  • 51
  • 1
  • 5

1 Answers1

3

I just pulled your project and tested it with a local server. I think there was a mistake in the documentation. If you set --base-href to an x value, your application will use /x as the based path. See the base tag.

The solution is simple, let it have the default value by removing the option

ng build --prod --output-path docs

or set it to the current directory

ng build --prod --output-path docs --base-href .

I hope this will help.

Quan VO
  • 1,258
  • 11
  • 19
  • Thank you so much. Yes, that would works. Then go to Github repository, in the setting menu, in the deploy branch selection, choose to deploy from master/docs branch. By this way, the URL for the online website would be https://username.github.io/project name – Frank Xiao Oct 18 '19 at 12:23
  • Glad to help. Could you please upvote my answer btw? – Quan VO Oct 18 '19 at 12:33