This project is a 5-day, three-hour weather broadcast app based on the city name. It uses the OpenWeather API to fetch weather data.
Follow these steps to run the project locally:
git clone https://github.com/M-YasirGhaffar/openweather-api
cd openweather-api
npm install
To use the OpenWeather API, you need an API key. You can obtain one by following these steps:
- Go to the OpenWeatherMap website.
- Sign up for a free account or log in if you already have one.
- Once logged in, go to the "API keys" section in your account settings.
- Generate a new API key.
- Copy the API key.
Create a file named .env
in the project's root directory and add your OpenWeather API key:
OPEN_WEATHER_API=your_openweather_api_key
Replace your_openweather_api_key
with the API key.
Run the following command to start the application:
npm start
Open your web browser and navigate to http://localhost:3000 to access the application.
- Select a city from the dropdown menu.
- Click the "Submit" button.
- View the 5-day, three-hour weather broadcast for the selected city.
- body-parser: ^1.20.2
- dotenv: ^16.3.1
- ejs: ^3.1.9
- express: ^4.18.2