Skip to content

A small weather application that uses http requests to get the current weather in a given location.

Notifications You must be signed in to change notification settings

lukejcn/weather-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather Application

A small weather application that uses http requests to get the current weather in a given location.

Installation

Clone the repository into your own directory.

git clone https://github.com/lukejcn/weather-app.git

cd into the new directory and npm install which will download and install the required npm packages

cd weather-app
npm install

Weatherstack & Mapbox API's

The application connects to two APIs:

  • MapBox - Used to obtain latitude and longtitude information from an address passed as a string.
  • Weatherstack - Used to obtain weather information using the latitude and longtitude from the mapbox API.

You'll need to sign up to both of these and obtain API keys to get this app to work.

Weatherstack

MapBox

Environment Variables

Now that you have your API keys, you need to load them into the app. In the project's directory, create a .env file. Then, create two variables for your API keys called WEATHERSTACK_API and MAPBOX_API

nano .env
WEATHERSTACK_API=************
MAPBOX_API=****************

Requirements

  • Node.js

Run

npm run start

Run in Development mode with nodemon

npm run dev

This uses the nodemmon npm package that's a development dependency - will be uninstalled when the app is put into production

About

A small weather application that uses http requests to get the current weather in a given location.

Resources

Stars

Watchers

Forks