Download scripts/check_backend.py from Mohansree/bsure-api: direct link, hf CLI and curl.
- Browser
- Download file 426 Bytes
-
https://huggingface.co/spaces/Mohansree/bsure-api/resolve/main/scripts/check_backend.py
- Command line
-
hf download hf://spaces/Mohansree/bsure-api/scripts/check_backend.py
-
curl -L -o check_backend.py https://huggingface.co/spaces/Mohansree/bsure-api/resolve/main/scripts/check_backend.py
426 Bytes
| import requests | |
| try: | |
| print("Checking Local Backend...") | |
| r = requests.get("http://localhost:8000/", timeout=2) | |
| print(f"Status: {r.status_code}") | |
| print("Backend is UP") | |
| print("Checking Wardrobe Endpoint...") | |
| r2 = requests.get("http://localhost:8000/wardrobe/1", timeout=2) # Assuming user 1 | |
| print(f"Wardrobe Status: {r2.status_code}") | |
| except Exception as e: | |
| print(f"Backend Down: {e}") | |