Spaces:
Sleeping
Sleeping
File size: 600 Bytes
7d51cb2 715b529 7d51cb2 715b529 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | """OpenEnv-compatible FastAPI app export."""
from __future__ import annotations
import os
import sys
from pathlib import Path
BACKEND_DIR = Path(__file__).resolve().parents[1] / "backend"
if str(BACKEND_DIR) not in sys.path:
sys.path.insert(0, str(BACKEND_DIR))
from app.main import app # noqa: E402,F401
def main() -> None:
"""Run the FastAPI app for OpenEnv multi-mode validation."""
import uvicorn
host = os.getenv("HOST", "0.0.0.0")
port = int(os.getenv("PORT", "7860"))
uvicorn.run("server.app:app", host=host, port=port)
if __name__ == "__main__":
main()
|