From c074d4ee5c2a564813dfe0658b879cacfe278d65 Mon Sep 17 00:00:00 2001 From: zucham Date: Fri, 2 May 2025 00:24:44 +0200 Subject: [PATCH] =?UTF-8?q?Nechce=C5=A1=20to=20aspo=C5=88=20vyextrahovat?= =?UTF-8?q?=20n=C4=9Bkam=20nahoru=3F=20=F0=9F=98=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 5c330f9..eb86375 100644 --- a/main.py +++ b/main.py @@ -7,6 +7,10 @@ import json import httpx import asyncio +# Some useful variables +PEEHAITCHPEA_ENDPOINT = "http://localhost:9000/api.php?cmd=getselectedmessage" +PYTHAGORAS_PORT = 9000 + # Configure logging logging.basicConfig( level=logging.INFO, @@ -120,7 +124,7 @@ async def fetch_selected_message(): """ try: async with httpx.AsyncClient() as client: - response = await client.get("http://localhost:9000/api.php?cmd=getselectedmessage") + response = await client.get(PEEHAITCHPEA_ENDPOINT) if response.status_code == 200: message = response.text.strip() if message: @@ -160,4 +164,4 @@ async def startup_event(): # Main function and app entry point if __name__ == "__main__": - uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True) + uvicorn.run("main:app", host="0.0.0.0", port=PYTHAGORAS_PORT, reload=True)