Creating a weather app using node.js and the OpenWeatherMap API

Hi people!!

Today I will teach you how to make this simple app using node.js and the OpenWeatherMap API.

1st step: Create an account on the OpenWeatherMap website.
In order to make things easier, you can create the account through this link: https://home.openweathermap.org/users/sign_up

2nd step: Select the “API Keys” option, then enter a Name in the “Name” field and, finally, click on the “Generate” button;

3rd step: Open the command line and enter the following commands:
- mkdir nodejs-weather
- npm init

The result will be something like this:

4th step: Create the index.js file on the command line and insert the following commands:
- touch index.js
- npm install request --save

The result will be according to this image:

5th step: Open the index.js file and insert the following code:

6th step: Run the app using the command:

And this is going to be the end result:

I hope you enjoyed!!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store