support SERVE_HOST env var for binding to 0.0.0.0

This commit is contained in:
2026-05-23 15:18:45 -04:00
parent 934ad40c56
commit 488239c593
+2 -1
View File
@@ -11,6 +11,7 @@ import httpx
SCRIPT_DIR = Path(__file__).resolve().parent
STATIC_DIR = SCRIPT_DIR
PORT = int(os.environ.get("SERVE_PORT", "18834"))
HOST = os.environ.get("SERVE_HOST", "127.0.0.1")
app = FastAPI(title="Project Directory")
@@ -192,4 +193,4 @@ async def index(path: str = ""):
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="127.0.0.1", port=PORT)
uvicorn.run(app, host=HOST, port=PORT)