Weather engine is a simple web application to get the current weather data of a location.
- clone the git repository
- cd into the folder
- run command "npm i"
- run command "node src/app.js"
-
Get your OpenWeather and Mapbox api keys, refer openweathermap.org/api and docs.mapbox.com/api/overview/
-
Create a .env file and write this code (replace "forecast" and "geocode" with the openweather and mapbox api keys respectively)
FORECAST = forecast
GEOCODE = geocode
- The user enters the location in the search bar
- The entered location then passed as a query to the Mapbox API
- The Mapbox API reverse geocodes the location and returns the corresponding latitude and longitude of the location entered.
- The latitude and longitude are then passed as a query in the open weather API, which returns the current weather information of that location.
-
axios
-
dotenv
-
express
-
hbs
-
public/: Contains views functionality logics, script, and styles.
-
templates/: Contains HTML files for rendering on views.
-
src/: Main script files for running the NodeJS application.