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.
In this tutorial, I’ll take you through all the steps involved in hosting a React App on GitHub pages.
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
create-react-app
Note that you could have also installed create-react-app
using 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.
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