Renecto commited on
Commit
add9345
·
verified ·
1 Parent(s): e692a11

Deploy habadashi_login gateway

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -236,13 +236,11 @@ print(f" - Health: /healthz")
236
  print(f" - Logout: /logout")
237
  print("=" * 80)
238
 
239
- # Launch the app immediately at module level for HF Space
240
- print("[ENTRYPOINT] Launching app at module level for HF Space compatibility")
241
  print(f"[ENTRYPOINT] App type: {type(app)}")
 
 
242
 
243
- import uvicorn
244
- # Use environment variable PORT if available (HF Space sets this)
245
- port = int(os.environ.get("PORT", 7860))
246
- print(f"[ENTRYPOINT] Binding to 0.0.0.0:{port}")
247
- print("[ENTRYPOINT] Starting uvicorn server...")
248
- uvicorn.run(app, host="0.0.0.0", port=port, log_level="info")
 
236
  print(f" - Logout: /logout")
237
  print("=" * 80)
238
 
239
+ # HF Space will automatically serve the 'app' variable
240
+ print("[ENTRYPOINT] FastAPI app with mounted Gradio UIs ready")
241
  print(f"[ENTRYPOINT] App type: {type(app)}")
242
+ print("[ENTRYPOINT] HF Space will bind port and serve automatically")
243
+ print("[ENTRYPOINT] No explicit uvicorn.run() needed - HF Space handles this")
244
 
245
+ # Note: Do NOT call uvicorn.run() here - HF Space does it automatically
246
+ # The 'app' variable (FastAPI with mounted Gradio apps) will be served by HF Space