xdragxt commited on
Commit
9a1232a
·
verified ·
1 Parent(s): 29bf600

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +4 -2
server.py CHANGED
@@ -7,6 +7,8 @@ app = FastAPI(docs_url=None, redoc_url="/")
7
  @app.get("/status")
8
  def hello():
9
  return {"message": "running"}
10
-
11
  if __name__ == "__main__":
12
- uvicorn.run(app, host="0.0.0.0", port=7860)
 
 
 
7
  @app.get("/status")
8
  def hello():
9
  return {"message": "running"}
10
+
11
  if __name__ == "__main__":
12
+ port = int(os.environ.get("PORT", 7860)) # Use HF Spaces port if provided
13
+ print(f"🚀 Starting server on port {port}")
14
+ uvicorn.run(app, host="0.0.0.0", port=port)