$ Serge Gatezh
~/posts/how-to-host-angular-application-on-github-pages
cat how-to-host-angular-application-on-github-pages.md

How to host Angular application on GitHub Pages

How to deploy an Angular application to GitHub Pages using angular-cli-ghpages with custom domain and routing support.

[Last update 04-04-2017]

To install the command run the following:

npm i -g angular-cli-ghpages

Note: you have to create the dist folder in before (e.g. ng build --prod)

ng build --prod --base-href "https://USERNAME.github.io/REPOSITORY/"
ngh

In case you use a custom domain for one of your repositories (like I do for this blog), you should use http instead

ng build --prod --base-href "http://YOURDOMAIN.com/REPOSITORY/"
ngh

For more information check angular-cli-ghpages GitHub Page.

There might be a problem with routing. If so check this FAQ

Filed under: Angular Github
./comments --list