File size: 619 Bytes
3f99e49
c6af75e
 
3f99e49
 
 
 
 
 
 
 
 
c6af75e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
Server entry point for multi-mode deployment.
Exposes the FastAPI app and a callable main() for use as a console script.
"""
import sys
import os

# Ensure the project root is on the path when this module is imported directly
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from app import app  # noqa: F401 — re-export for ASGI runners

__all__ = ["app", "main"]


def main():
    import uvicorn
    uvicorn.run(
        "server.app:app",
        host="0.0.0.0",
        port=int(os.environ.get("PORT", 7860)),
        reload=False,
    )


if __name__ == "__main__":
    main()