Angular 4 apps run locally but don't load on Github

This is my first attempt at creating an angular 4 application. I created a very simple angular 4 application. It loads correctly on my local machine, but when I deploy it to github, only index.html loads. Component files are optional. Things I tried - Make sure I map the docs folder to github. I tried to expand the dist folder instead of the source. I tried changing the base-href value to ".", "/", ". This is a link to my page: https://itsy-bitsy.imtqy.com/adventures/ , and my repo is https://github.com/ itsy-bitsy / adventures . I tried to publish it for several days and out of ideas. I will really appreciate understanding that I can do wrong.

+1
angular github-pages
source share
1 answer

Be sure to build to get the necessary files in dist.

ng build --prod 

First get all the relevant files from the Dist folder of your application

for me it was css files in the resources folder main.bundle.js polyfills.bundle.js vendor.bundle.js

Then click these files in the repo you created.

1 - If you want the application to run in the root directory - create a special repo named [yourgithubusername] .imtqy.com and run these files in the main branch

2 - If you want to create this page in a subdirectory of a marriage other than the root, create the gh-pages branches and paste these files into this branch.

In both cases, the way to access these expanded pages will be different.

In the first case it will be https: // [yourgithubusername] .imtqy.com , and in the second case it will be [yourgithubusername] .imtqy.com / [Repo name].

If it is assumed that you want to deploy it using the second case, be sure to change the base url pf in the index.html file to dist, since all route mappings depend on the path you specify and should be set to [/ branchname].

Github repository - https://github.com/rahulrsingh09/Deployment

+2
source share

All Articles