Spaces:
Sleeping
Sleeping
Download server/app.py from khushiii02/ticket-support-env: direct link, hf CLI and curl.
- Browser
- Download file 886 Bytes
-
https://huggingface.co/spaces/khushiii02/ticket-support-env/resolve/main/server/app.py
- Command line
-
hf download hf://spaces/khushiii02/ticket-support-env/server/app.py
-
curl -L -o app.py https://huggingface.co/spaces/khushiii02/ticket-support-env/resolve/main/server/app.py
886 Bytes
| """ | |
| server/app.py — Support Ticket Agent OpenEnv Server | |
| Required entry point for `openenv validate`. | |
| Rules: | |
| - Function must be named `main` (not start) | |
| - Must have if __name__ == '__main__': block | |
| - pyproject.toml must have: server = "server.app:main" | |
| """ | |
| from __future__ import annotations | |
| import os | |
| import sys | |
| # Add project root to path so server/ can import from root | |
| sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| # Re-export the FastAPI app from root main.py | |
| from main import app # noqa: F401 | |
| __all__ = ["app", "main"] | |
| def main() -> None: | |
| """Entry point called by `uv run server` and [project.scripts].""" | |
| import uvicorn | |
| uvicorn.run( | |
| "server.app:app", | |
| host="0.0.0.0", | |
| port=int(os.environ.get("PORT", "7860")), | |
| workers=1, | |
| reload=False, | |
| ) | |
| if __name__ == "__main__": | |
| main() |