Skip to content

Instantly share code, notes, and snippets.

@eamonnboyle
Last active February 23, 2021 10:22
Show Gist options
  • Save eamonnboyle/56cd1ed27b85722c9b5bb9dc8484d946 to your computer and use it in GitHub Desktop.
Save eamonnboyle/56cd1ed27b85722c9b5bb9dc8484d946 to your computer and use it in GitHub Desktop.
Weather App Tutorial - Reading Configuration
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