Skip to content

Commit d8b41bc

Browse files
committed
fix stella issue
Signed-off-by: Deborah Dahl <dahl@conversational-technologies.com>
1 parent c1ad814 commit d8b41bc

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

stella/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.vercel
2+
.env
3+
.env.*

stella/nasa.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import requests
2+
import os
23

34
# NASA API Key
4-
nasa_api_key = wVnaajaqfHQIaOhSyc5SQWFecweOwKAe54OUSuZT
5+
nasa_api_key = os.getenv("NASA_API_KEY", "DEMO_KEY")
56

67
# Construct the GET request URL
78
nasa_url = f"https://api.nasa.gov/planetary/apod?api_key={nasa_api_key}"

stella/nasa_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import requests
22
import re
3+
import os
34
from typing import Optional
45

56
# Parameters for the request
67
params = {
7-
"api_key": "wVnaajaqfHQIaOhSyc5SQWFecweOwKAe54OUSuZT", # Replace with your own key from https://api.nasa.gov
8+
# Use env var if provided; DEMO_KEY avoids hardcoding secrets in source.
9+
"api_key": os.getenv("NASA_API_KEY", "DEMO_KEY"),
810
"hd": True # Optional: True to get HD image URL
911
}
1012

0 commit comments

Comments
 (0)