creating error page for tech difficulties

This commit is contained in:
Beverly Nguyen
2025-04-17 15:01:22 -07:00
parent 3e0e290dc0
commit b4e239c9bb
5 changed files with 44 additions and 25 deletions

13
app/utils/api_health.py Normal file
View File

@@ -0,0 +1,13 @@
import os
import requests
from requests.exceptions import RequestException
def is_api_down():
api_base_url = os.getenv("API_BASE_URL", "http://localhost:6011")
try:
response = requests.get(api_base_url, timeout=2)
return response.status_code != 200
except RequestException:
return True