diff --git a/streamlit_app/api_client.py b/streamlit_app/api_client.py index 22b92c2..4d433c5 100644 --- a/streamlit_app/api_client.py +++ b/streamlit_app/api_client.py @@ -2,12 +2,8 @@ Модуль для работы с API """ import requests -import os from typing import Dict, Any, List, Tuple - -# Конфигурация API -API_BASE_URL = os.getenv("API_BASE_URL", "http://fastapi:8000") # Внутренний адрес для Docker -API_PUBLIC_URL = os.getenv("API_PUBLIC_URL", "http://localhost:8000") # Внешний адрес для пользователя +from config import API_BASE_URL, API_PUBLIC_URL def check_api_health() -> bool: diff --git a/streamlit_app/config.py b/streamlit_app/config.py index bb49d58..dbf2339 100644 --- a/streamlit_app/config.py +++ b/streamlit_app/config.py @@ -2,6 +2,11 @@ Конфигурация приложения """ import streamlit as st +import os + +# Конфигурация API +API_BASE_URL = os.getenv("API_BASE_URL", "http://fastapi:8000") # Внутренний адрес для Docker +API_PUBLIC_URL = os.getenv("API_PUBLIC_URL", "http://localhost:8000") # Внешний адрес для пользователя # Конфигурация страницы def setup_page_config(): diff --git a/streamlit_app/sidebar.py b/streamlit_app/sidebar.py index 557e7e9..479a6c9 100644 --- a/streamlit_app/sidebar.py +++ b/streamlit_app/sidebar.py @@ -2,7 +2,8 @@ Модуль для сайдбара """ import streamlit as st -from api_client import get_server_info, get_available_parsers, API_PUBLIC_URL +from api_client import get_server_info, get_available_parsers +from config import API_PUBLIC_URL def render_sidebar():