CCockrum commited on
Commit
d207c48
·
verified ·
1 Parent(s): 6090fff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import streamlit as st
 
2
  import requests
3
  import pandas as pd
4
  import plotly.express as px
@@ -13,7 +14,13 @@ information about asteroids and other near-Earth objects.
13
 
14
  # API Configuration
15
  NASA_API_URL = "https://api.nasa.gov/neo/rest/v1/feed"
16
- API_KEY = st.sidebar.text_input("NASA API Key", value="NASA_API_KEY", type="password")
 
 
 
 
 
 
17
 
18
  # Date selection
19
  st.sidebar.header("Search Parameters")
 
1
  import streamlit as st
2
+ import os
3
  import requests
4
  import pandas as pd
5
  import plotly.express as px
 
14
 
15
  # API Configuration
16
  NASA_API_URL = "https://api.nasa.gov/neo/rest/v1/feed"
17
+ import os # Ensure this is at the top
18
+
19
+ API_KEY = os.getenv("NASA_API_KEY")
20
+ if not API_KEY:
21
+ st.error("🚨 NASA_API_KEY environment variable is not set.")
22
+ st.stop()
23
+
24
 
25
  # Date selection
26
  st.sidebar.header("Search Parameters")