Weather app in Node.js that displays current weather data from any city using the OpenWeatherMap API.
- Node.js
- Embedded JavaScript templates
- Express
- JavaScript
node v16.1.x
cd weather
npm install body-parser dotenv ejs express request
Navigate to https://openweathermap.org/ and create an account/sign in.
Once logged in, generate an API key to access the public weather data.
Create an .env
file and include the following:
API_KEY = (API KEY HERE)
Navigate to the weather
directory and run main.js
. This can be paired
with the nodemon tool via npm install nodemon
to easily start the project with the command
npm start