Last active
February 23, 2021 10:22
-
-
Save eamonnboyle/56cd1ed27b85722c9b5bb9dc8484d946 to your computer and use it in GitHub Desktop.
Weather App Tutorial - Reading Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const key: string = process.env.REACT_APP_OPEN_WEATHER_API_KEY as string; | |
if (key === undefined) { | |
throw new Error('No Open Weather API Key defined - ensure you set a variable called REACT_APP_OPEN_WEATHER_API_KEY') | |
} | |
const keyQuery = `appid=${key}` | |
const server = 'http://api.openweathermap.org/data/2.5'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment