A simple weather app pet project made in Node, Express and ejs which leverages the OpenWeatherMap API. It displays the current weather information based on the entered city.
This project uses node and npm. Go check them out if you don't have them locally installed.
$ npm install$ npm startDev mode utilizes nodemon which allows continuous monitoring for changes made in the app.
$ npm run devBy default, the application is listening to port 5000.
http://localhost:5000/An .env file containing the environment variables needed by the application to run needs to be created in the root directory.
# .env
# Base url of the OpenWeatherMap API
API_URL='https://api.openweathermap.org/data/2.5/weather'
# API key generated in OpenWeatherMap
API_KEY='<OpenWeatherMap API key>'
# Port which the application is listening to
PORT=5000This application creates a request to the OpenWeatherMap API to get a city's current weather data.
Check OpenWeatherMap FAQs for instructions on how to create an API key.
More info on OpenWeatherMap Guide.