Spaces:
Sleeping
Sleeping
File size: 886 Bytes
cecafbf 2267c20 cecafbf 2267c20 cecafbf 2267c20 cecafbf 2267c20 | 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 29 30 31 32 33 34 35 36 37 | """
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() |