0

https://coursetro.com/posts/code/64/How-to-Deploy-an-Angular-App-(Angular-4) I have followed this tutorial to deploy my Angular4 application and in the end, I got that it is published but when I went to my Git Hub URL, I do not see my Application running.

Below is my repository URL:

enter image description here

https://github.com/shekharramola/movieApp

1 Answer 1

1

Deployment

Angular 2 Deployment in Github Pages

Testing Deployment of Angular2 Webpack in ghpages

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

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

Then push this files in the repo which you have created.

1 -- If you want the application to run on the root directory - create a special repo with the name [yourgithubusername].github.io and push these files in the master branch

2 -- Where as if you want to create these page in the sub directory of in a different brach other than that of the root , create a branch gh-pages and push these files in that branch.

In both the cases the way we access these deployed pages will be different .

For the First Case it will be https://[yourgithubusername].github.io and for the second case it will be [yourgithubusername].github.io/[Repo name].

If Suppose you want to deploy it using the second case make sure to change the base url pf the index.html file in the dist as all the route mappings depend on the path you give and it should be set to [/branchname].

Working Example Repo and LINK

Sign up to request clarification or add additional context in comments.

2 Comments

I was following the second way and as you told me I have renamed the base URL in index file from / to /gh-pages. here is the [link] github.com/shekharramola/movieApp/tree/gh-pages so according to second case I need to run the application with the help of this URL[link] shekharramola.github.io/movieApp but I am getting this error. probably there is some issue with the path. so when I am accesing this URL, in the console, I am getting these type of errors. net::ERR_ABORTED
@ShekharRamoladoes it work , i guess it is deployed some problem acessing the bundles is it inside a directory , if so move it out

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.