An Express.js server that acts as a proxy API layer for OpenWeatherMap.
It provides simplified, secure access to various weather data services including current weather, forecasts, air quality, and geocoding — while preventing CORS issues and keeping API keys safe.
- ✅ Proxy endpoints to the OpenWeatherMap API
- 🌐 Current Weather by Latitude & Longitude
- 📆 Hourly & Daily Weather Forecasts
- 🏭 Air Quality Data
- 🗺️ City Name → Geocoding (Lat/Lon)
- 🔒 Hides your OpenWeatherMap API key from frontend clients
- 🛡️ CORS enabled for frontend requests
- 🌱
.envconfiguration supported - 📦 Ready for deployment (Render, Railway, etc.)
├── server.js # Entry point ├── routes/ │ └── openWeather.js # Route definitions ├── controller/ │ └── openWeatherController.js # API logic ├── .env # API key (not committed) ├── package.json └── README.md
All routes are prefixed with:
Returns current weather for given coordinates.
Returns hourly forecast for given coordinates. cnt is the number of forecast entries.
Returns daily forecast. (Note: endpoint depends on plan availability.)
Returns air pollution and quality index for a given location.
Returns geolocation (lat/lon) of a city.
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-namenpm installAPI_KEY=your_openweather_api_key
BASE_URL=Openweather_base_URL
PORT=5000npm start