- Introduction
- Features
- Prerequisites
- Installation
- Configuration
- Connecting to the Frontend
- Usage
- Starting the Server
The Weather App backend serves as an intermediary between the frontend and OpenWeather API, providing weather data to the app. This README explains how to set up, configure, and connect the backend to the frontend.
- Fetches weather data from OpenWeather.
- Provides API endpoints for frontend integration.
Before setting up the backend, ensure you have the following prerequisites installed on your system:
- Node.js and npm installed.
- An OpenWeather API key. You can obtain one by signing up at OpenWeather.
Follow these steps to set up the Weather App backend:
-
Clone this repository to your local machine:
git clone https://github.com/yourusername/weather-app-backend.git
-
Navigate to the project directory:
cd weather-app-backend
-
Install project dependencies:
npm install
-
in the a
server.js
file with your OpenWeather API key:api_key=Your_Api_Key_Here
This API key is essential for the backend to securely access OpenWeather data.
To connect the backend to the frontend, follow these steps:
-
Clone the frontend repository to your local machine:
git clone https://github.com/Madhavmoudhgal/Weather-App.git
-
In your frontend project, make HTTP requests to the appropriate endpoints of this backend.
-
Configure the frontend to use the backend's base URL for API requests.
This backend automatically fetches and serves weather data to the frontend. There are no specific actions required for regular usage.
Before using the backend, you need to start the Node.js server. To do this, run the following command in the backend project directory:
node server.js
The server will start, and your backend will be up and running, ready to serve weather data to the frontend.