GitHub Pages has emerged as an excellent way for developers to deploy their projects online for free. It’s fast, free, and pretty simple as it lets you host static websites **directly **from your GitHub repositories.

Getting Started

In this tutorial, I’ll take you through all the steps involved in hosting a React App on GitHub pages.

Prerequisites:

  1. GitHub Account
  2. Git installed and set up on your local machine
  3. Npm and Node.js(v8.10.0 or higher) installed on your machine

Set up React App

For the simplicity of this tutorial, we’ll be using create-react-app to set up our react project. Run the following command in the terminal to get your react app set up:

$ npx create-react-app demo-app

Image for post

create-react-app

Note that you could have also installed create-react-appusing npm install create-react-app and then run the command create-react-app demo-app . Developers often use npx instead of npm as it lets you execute package commands without having to install that particular package on your local system.

Initialize Git repository

Go to GitHub and create a repository for your react app. Once you’ve created the repository, run the following commands from the directory where you created your react app.

#free-hosting #github #github-pages #react #hosting

How to Deploy React Apps for Free With GitHub Pages
9.05 GEEK