vaelentine / weather-app

Allows a user to fetch up-to-date weather data for their location from the OpenWeather API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

weather-app

Allows a user to fetch up-to-date weather data for their location from the OpenWeather API

image

To set up this app:

  1. Clone this repo:
  • git clone https://github.com/vaelentine/weather-app.git
  1. Go to https://home.openweathermap.org/users/sign_up,
  1. At the root folder of your cloned repo, create a .env file and add the following key and value pair:
  • REACT_APP_WEATHER_API_KEY=<your api key>
  1. Install app and dependencies.
  • run npm install

⚠️ Note that if you skip step 3

  • you will see a warning banner on loading the app ❗
  • and the app snapshot test will fail 💣
  • (For testing purposes, feel free to use my api key REACT_APP_WEATHER_API_KEY=9b1d1757d00d6749255000675acc1e01)

Running the app:

Provided you did all of the prerequisites, you should now be able to run commands:

  • To execute test suites, run npm test
  • To run in dev mode, run npm start. This will compile the app and start up a browser session at localhost:3000.

Deploy to production:

  • make sure 'serve' is installed, run npm i serve -g
  • Prepare a production build npm run build
  • Then, serve it with serve -s build -l (default port is 5000 if no port provided)

About

Allows a user to fetch up-to-date weather data for their location from the OpenWeather API

License:MIT License


Languages

Language:TypeScript 73.6%Language:CSS 14.9%Language:HTML 10.1%Language:JavaScript 1.4%