Week 1 - Assignment
Week 1 - Assignment
Objective
Create a web-based weather application using Node.js, Express, and a templating
engine (like EJS or Pug). This app will fetch and display the weather information of a
city entered by the user. The goal of this project is to learn how to set up a Node.js
server, integrate a templating engine, and make HTTP requests to external APIs.
Requirements
1. User Interface:
- Create a form where users can input a city name.
- Upon form submission, the app should display the weather information of the city.
2. Templating Engine:
- Use a templating engine like EJS or Pug to render dynamic HTML pages.
- Display the weather information dynamically based on the city entered.
3. API Integration:
- Use the OpenWeatherMap API (https://openweathermap.org/api) or another weather
API to fetch weather data.
- The API key should be stored in environment variables (`.env` file).
Technical Requirements:
2. Templating Engine:
- Use EJS, Pug, or Handlebars to create dynamic views.
- Render the weather data on the web page using the templating engine.
3. Environment Variables:
- Store your API key in a `.env` file for security reasons.
- Use the `dotenv` package to load environment variables into your Node.js app.
4. API Call:
- Use `axios` or `node-fetch` to make the API request to fetch the weather data.
Submission:
● Submit the project as a zipped folder.
● The project should include a README.md file with instructions on how to run the
application, install dependencies, and how to obtain an API key for the weather
API.