v.0.11.3 api-server public port 8000

This commit is contained in:
tiijay
2025-11-21 19:07:41 +00:00
parent c27b97fc71
commit 115e402b0d
5 changed files with 27 additions and 19 deletions

View File

@@ -1,7 +1,9 @@
import urequests # type: ignore
import json
BASE_API_URL: str = "http://api-server:8000"
# BASE_API_URL: str = "http://api-server:8000"
# BASE_API_URL: str = "http://j-agent-01:8000"
BASE_API_URL: str = "http://192.168.178.105:8000"
class API_Server_Checker:
@@ -16,6 +18,7 @@ class API_Server_Checker:
)
print(f"query: {items_url}")
r: any
try:
r = urequests.get(items_url)
print("Status-Code:", r.status_code)
@@ -26,9 +29,12 @@ class API_Server_Checker:
else:
print("api-server error:", json_resp["error"]["message"])
except OSError as e:
print(f"api-server call failed: {e}")
print("Network error:", e)
except Exception as e:
print("Error:", e)
finally:
r.close()
if r:
r.close()
def check(self, item_id: int):
self._get_items(item_id)