Clone or download the repository
Clone the repository from GitHub:Or download the ZIP from GitHub and extract it.
Get an OpenWeatherMap API key
The app requires a valid API key from OpenWeatherMap to fetch weather data. Follow the API key guide to create a free account and generate a key.
Add your API key to script.js
Open Replace the value after
script.js and locate the URL string on the first line:appid= with your own API key:Open index.html in a browser
Because the app is fully static (HTML, CSS, and JavaScript only), no build step or local server is required. Open
index.html directly:- macOS / Linux:
open index.htmlin the terminal, or double-click the file in Finder / Files. - Windows: Double-click
index.htmlin File Explorer, or right-click and choose “Open with” your browser.
Deployment
The Weather App is a static site with no build step, so it can be deployed anywhere that serves static files.GitHub Pages
- Push the project to a GitHub repository.
- Go to Settings > Pages in your repository.
- Set the source branch to
main(ormaster) and the folder to/ (root). - GitHub Pages will publish the site at
https://<username>.github.io/<repo-name>/.
Netlify
- Log in to Netlify and click Add new site > Import an existing project.
- Connect your GitHub repository.
- Leave the build command empty and set the publish directory to
.(root). - Click Deploy site.
Vercel
- Log in to Vercel and click Add New > Project.
- Import your GitHub repository.
- Vercel auto-detects that there is no framework. Leave all defaults and click Deploy.