Skip to content

A weather web app that will tell you the weather depending on the location using the OpenWeather API. Built using Node.js and Express.

Notifications You must be signed in to change notification settings

ariana124/weather_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather App

A simple weather web application that displays the current weather in a city depending on the zip code using the OpenWeather Current Weather Data API.

Installation

git clone https://github.com/ariana124/weather_app.git

Check to make sure you have node installed using:

node -v

If you don't have node installed, download it here.

Once you have this repository cloned and node installed run the command:

npm install

After running this command you should have a folder labeled node_modules in the repository.

Generating an API Key

In order to use my application you need to have an API key from the OpenWeather website. You can click this link that will take you to their sign in page if you have an account already, but if you don't then you have to create one.

After successfully creating an account you'll have to navigate to the API keys menu as shown below.

Account Menu

By default when you create your account you have an API key already generated for you, as displayed on the left. However, if you accidentally upload your API key to a public respository (like me... whoops), you can easily generate a new key with a new name on the right.

Generate API Key

Make sure to copy your key so that you'll be able to use it for the next step.

Using Your API Key

Alrighty now that you have an API key, it's time to actually use it.

Assuming you have this github repository already cloned, within the file app.js on line 21, there's a variable called apiKey that's currently set as an empty string.

Empty Key Slot

Within the quotes just paste your API key, save the file, and you're now set up to run the app!

Pasting the API Key

Running the Application

After installing the npm packages with the prior command, you can now use the command:

nodemon app.js

Nodemon is a package that automatically restarts your server when you make and save any changes to the app.js file. It's a lot more convenient than saving the file, quitting the current session with Ctrl + C, and running node app.js everytime you make a change and save the file.

Your server should now be running on port 3000, so now you can type localhost:3000 into your web browser and then enter in your zip code to get your current weather.

Usage

Home

Input

Output

About

A weather web app that will tell you the weather depending on the location using the OpenWeather API. Built using Node.js and Express.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published