Yes! You can absolutely do this with GitHub. In fact, GitHub Pages is one of the easiest ways to host a simple HTML/CSS/JS project like your Random Number Picker so anyone can access it online.
Here’s how it works:
1️⃣ What You Need
-
A GitHub account (free)
-
Your project folder with
index.html
(and optional CSS/JS files)
2️⃣ Steps on GitHub
Step 1: Create a Repository
-
Go to GitHub → log in.
-
Click New Repository.
-
Name it, e.g.,
random-number-picker
. -
Make it Public → click Create repository.
Step 2: Upload Your Project Files
Option A: Direct Upload (No Git Installed)
-
Open your repo → click Add file → Upload files
-
Drag and drop
index.html
(and any CSS/JS files) -
Click Commit changes
Option B: Using Git Command Line (if Git installed)
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/username/random-number-picker.git
git push -u origin main
Step 3: Enable GitHub Pages
-
Go to Settings → Pages in your repo.
-
Under Source, select:
-
Branch:
main
-
Folder:
/root
-
-
Click Save.
-
GitHub will give you a link like:
https://username.github.io/random-number-picker/
✅ Anyone can now open your Random Number Picker using that link.
3️⃣ Updating the Project
-
Make changes locally
-
Commit and push changes again
git add .
git commit -m "Update project"
git push
-
The GitHub Pages link will update automatically.
4️⃣ Summary
Step | What to do |
---|---|
Create repo | Name it and make it public |
Upload files | index.html and any CSS/JS |
Enable GitHub Pages | Settings → Pages → select main branch / root |
Share link | GitHub gives URL to open your app anywhere |
0 comments:
Post a Comment