desinez commited on
Commit
7f62ff3
·
1 Parent(s): 99f5531

Fix internal service API base routing for Hugging Face network interface

Browse files
Files changed (1) hide show
  1. frontend/services/api.py +4 -1
frontend/services/api.py CHANGED
@@ -1,7 +1,10 @@
1
  import requests
2
  import os
3
 
4
- BASE_URL = "http://127.0.0.1:8000" # Update this to your FastAPI port
 
 
 
5
 
6
  class PvRecNetAPI:
7
  @staticmethod
 
1
  import requests
2
  import os
3
 
4
+ # Dynamically pull the port from the environment (will be 7860 on Hugging Face)
5
+ # or fall back to 8000 if you run it locally.
6
+ PORT = os.environ.get("PORT", "8000")
7
+ BASE_URL = f"http://127.0.0.1:{PORT}"
8
 
9
  class PvRecNetAPI:
10
  @staticmethod