File size: 762 Bytes
83353c3
4d3cf11
2122497
 
 
 
 
 
44508a2
4d3cf11
2122497
4d3cf11
 
 
 
 
 
 
 
2122497
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python3
"""Streamlit-native entry point for Streamlit Cloud deployment."""
import streamlit as st
import os
import sys

# Add the project root to the Python path
sys.path.insert(0, os.path.abspath('.'))

# **no** load_dotenv() here
fred_key = st.secrets.get("FRED_API_KEY", "")
if not fred_key:
    st.error("❌ FRED API key not found in Streamlit secrets.")
    st.stop()

# make it available to downstream code
os.environ["FRED_API_KEY"] = fred_key

# now import and run your real app
try:
    from frontend.app import main as app_main
    app_main()
except ImportError as e:
    st.error(f"❌ Failed to import main function: {e}")
    st.info("Please check that the frontend/app.py file exists and contains a main() function.")
    st.stop()