Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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")
|