cwadayi's picture
Upload 8 files
744cd23 verified
raw
history blame
700 Bytes
# app.py
from core.visits import get_and_update_visits
from ui.layouts import create_ui
# --- 1. Update site visit count on startup ---
# This part runs only once when the application starts.
try:
count = get_and_update_visits()
visit_count_html = f"🚀 **總載入次數:** {count}"
print(f"Application loaded. Total visits: {count}")
except Exception as e:
visit_count_html = "🚀 **總載入次數:** N/A"
print(f"Could not update visit count: {e}")
# --- 2. Create the main UI by passing the dynamic content into the layout function ---
demo = create_ui(visit_count_html)
# --- 3. Launch the application ---
if __name__ == "__main__":
demo.launch()