Skip to main content
1

Clone or download the repository

Clone the repository from GitHub:
git clone https://github.com/yash2000-star/weather-app
cd weather-app
Or download the ZIP from GitHub and extract it.
2

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.
3

Add your API key to script.js

Open script.js and locate the URL string on the first line:
const link = "https://api.openweathermap.org/data/2.5/weather?q=jaipur&appid=a41b6d64a06f2c61e7c1975a953f6cc8";
Replace the value after appid= with your own API key:
const link = "https://api.openweathermap.org/data/2.5/weather?q=jaipur&appid=YOUR_API_KEY";
Never commit a real API key to a public repository. Add script.js to your .gitignore, or remove the key before pushing. Exposed keys can be abused by others and may result in unexpected charges or account suspension.
4

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.html in the terminal, or double-click the file in Finder / Files.
  • Windows: Double-click index.html in File Explorer, or right-click and choose “Open with” your browser.
The card will display the current weather for Jaipur (or whichever city you configured).

Deployment

The Weather App is a static site with no build step, so it can be deployed anywhere that serves static files.

GitHub Pages

  1. Push the project to a GitHub repository.
  2. Go to Settings > Pages in your repository.
  3. Set the source branch to main (or master) and the folder to / (root).
  4. GitHub Pages will publish the site at https://<username>.github.io/<repo-name>/.

Netlify

  1. Log in to Netlify and click Add new site > Import an existing project.
  2. Connect your GitHub repository.
  3. Leave the build command empty and set the publish directory to . (root).
  4. Click Deploy site.

Vercel

  1. Log in to Vercel and click Add New > Project.
  2. Import your GitHub repository.
  3. Vercel auto-detects that there is no framework. Leave all defaults and click Deploy.

Build docs developers (and LLMs) love