Skip to content

Commit dda1c07

Browse files
author
Andrew Evans
committed
finished setting up environment variables correctly
1 parent efce9ec commit dda1c07

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
- In order to get current conditions, this application uses the Open Weather Map API [here](https://openweathermap.org/api)
1414
- In order to use Open Weather MAP API, you'll need to create a key [here](https://openweathermap.org/appid)
1515
- You'll also need to export an environment variable with the key name to $OPEN_WEATHER_MAP_API_KEY
16-
- Once you've created your key and saved the variable in your bash_profile run the npm script `environment-variables` to populate the value for the project
16+
- Once you've created your key and saved the variable in your bash_profile or current session run the npm script `environment-variables` to populate the key value to the project's environment files

scripts/environment_variables.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
with open('src/environments/environment.ts', 'r') as file :
55
filedata = file.read()
66

7-
filedata = filedata.replace('open_weather_map_api_key', sys.argv[1])
7+
filedata = filedata.replace('OPEN_WEATHER_MAP_API_KEY', sys.argv[1])
88

99
with open('src/environments/environment.ts', 'w') as file:
1010
file.write(filedata)
@@ -13,7 +13,7 @@
1313
with open('src/environments/environment.prod.ts', 'r') as file :
1414
filedata = file.read()
1515

16-
filedata = filedata.replace('open_weather_map_api_key', sys.argv[1])
16+
filedata = filedata.replace('OPEN_WEATHER_MAP_API_KEY', sys.argv[1])
1717

1818
with open('src/environments/environment.prod.ts', 'w') as file:
1919
file.write(filedata)

src/environments/environment.prod.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const environment = {
22
production: true,
3-
openWeatherMapAPIKey: 'open_weather_map_api_key',
3+
openWeatherMapAPIKey: 'OPEN_WEATHER_MAP_API_KEY',
44
noaaMetaDataEndpoint: 'https://api.weather.gov/points/'
55
};

src/environments/environment.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
export const environment = {
66
production: false,
7-
openWeatherMapAPIKey: 'open_weather_map_api_key',
7+
openWeatherMapAPIKey: 'OPEN_WEATHER_MAP_API_KEY',
88
noaaMetaDataEndpoint: 'https://api.weather.gov/points/'
99
};
1010

0 commit comments

Comments
 (0)