Code Along: Hosting with Github Pages

Code Along: Hosting with Github Pages

  • Together we’ll walk through the process of hosting a static application, an application that does not have a server (i.e. Express), on Github Pages

Instructions

1. Find Traffic Light project

Using your operating system’s finder / explorer application, copy your Traffic Light application (project name: traffic-light) application from a lesson earlier in the course folder to your lesson_17 folder

  • If you do not have a working version of traffic-light you can clone down a working version here


2. Set up Git for the Traffic Light application

  • On the command line, navigate to the project folder for the traffic-light application in your lesson_17 folder and delete the .git folder by running the following command:

    $ rm -rf .git
    
  • This command will remove the local repository from this copy of the traffic-light application

  • Initialize a new git repository and run git add . and git commit -m "initial commit"

    $ git init && git add . && git commit -m "initial commit"
    


3. Host the project on Github Pages


4. Delete the Github Pages repository (Only do this after you’ve completed Step #3)

  • Congrats, you’ve successfully launched a static application on Github Pages

  • Since Github only allows you to have one “Github Pages repository” per Github account, you should delete this repository so it can be available for your Final Project or some other application or site you’d like to host in the future

  • Follow the steps below to delete your Github Pages repository (your_account_name/your_account_name.github.io):