Skip to content

Commit 90e1f9c

Browse files
authored
Update port handling for Cloud
Changes: Robust port handling for Cloud environments.
1 parent 0d28276 commit 90e1f9c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

run.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
import os
33
import logging
44

5-
# Configure production logging
5+
# Configure structured logging
66
logging.basicConfig(level=logging.INFO)
77
logger = logging.getLogger("Structura")
88

99
if __name__ == "__main__":
10-
# Hugging Face expects Port 7860. Render expects $PORT.
10+
# Hugging Face Spaces defaults to 7860, Render uses PORT env var
1111
port = int(os.getenv("PORT", 7860))
1212

1313
logger.info(f"🚀 Structura System Starting on Port {port}...")
1414

15-
# We import the app string to allow workers to load it dynamically
15+
# Run Uvicorn with the FastHTML app factory
1616
uvicorn.run(
1717
"app.main:app",
1818
host="0.0.0.0",
1919
port=port,
20-
reload=False, # Set to True for local dev
20+
reload=False,
2121
log_level="info"
2222
)

0 commit comments

Comments
 (0)