This is a simple Weather App that allows users to search for the current weather conditions of a city. The app fetches weather data from the OpenWeatherMap API and displays it to the user.
- config.js: Contains API keys for the weather and geolocation services.
- index.html: The main HTML file that structures the web page.
- script.js: The JavaScript file that handles the logic for fetching and displaying weather data.
- style.css: The CSS file that styles the web page.
- Open
index.html
in a web browser. - Enter the name of a city in the input field.
- Click the "Search" button.
- The app will display the current weather conditions for the specified city.
- Geoapify Geocoding API: Used to get the coordinates (latitude and longitude) of the city.
- OpenWeatherMap API: Used to get the current weather data for the specified coordinates.
The API keys are stored in the config.js
file. Replace the placeholder keys with your own API keys:
const config = {
WEATHER_API_KEY: "your_openweathermap_api_key",
GEO_API_KEY: "your_geoapify_api_key"
};
export default config;