An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
How to Host your React App for Free. (Part 1)
In this Blog, we will see how to host a react JS app for free. There are so many ways to host your app online for free but in this blog we will see how to host on github pages.
Hosting a normal html, css and js files to github is very easy, but when it comes to react js it is a bit tricky.
Let's get started.
Step 1:
First step we need to do is to add Homepage
to package.json
"homepage": "https://myusername.github.io/my-app",
it you want to host to github user page
"homepage": "https://myusername.github.io/",
Step 2:
The next step you need to do is to install gh-pages
. to install run the following command in the terminal
npm install --save gh-pages
then add the following lines of code in your package.json
scripts
"predeploy": "npm run build","deploy": "gh-pages -d build"
Step 3:
The very next step is to run the following command
npm run deploy
Now you are done
you have successfully hosted your react app on github
Thank You for reading
Also Read :
MongoDB beginner tutorial
Express JS getting started
Original Link: https://dev.to/vamsitupakula_/how-to-host-your-react-app-for-free-part-1-2e6e
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To