DEV Community

Cover image for Host React JS App for FREE with GitHub Pages
Samitha Wijesekara
Samitha Wijesekara

Posted on

5 4

Host React JS App for FREE with GitHub Pages

Commands Used

Step 1
▶️ git remote add origin [YOUR REPO LINK]
▶️ git add -A
▶️ git commit -m "Initial commit"
▶️ git push -u origin main

Step 2
Add this code line to package.json file -
▶️ "homepage": "https://[USERNAME].github.io/[YOUR REPO NAME]",

Step 3
▶️ npm install gh-pages --save-dev

Step 4
Add this scripts to package.json file -
▶️ "predeploy": "npm run build",
▶️ "deploy": "gh-pages -d build",

Step 5
▶️ npm run deploy

Top comments (0)

Cloudinary image

Optimize, customize, deliver, manage and analyze your images.

Remove background in all your web images at the same time, use outpainting to expand images with matching content, remove objects via open-set object detection and fill, recolor, crop, resize... Discover these and hundreds more ways to manage your web images and videos on a scale.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay