-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
36 lines (27 loc) · 770 Bytes
/
run.py
File metadata and controls
36 lines (27 loc) · 770 Bytes
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
# Orchestration Engine - Entry Point
#
# Launches the FastAPI server via uvicorn.
#
# Depends on: backend/app.py, backend/config.py, backend/logging_config.py
# Used by: (run directly)
import sys
import uvicorn
from backend.logging_config import setup_logging
def main():
try:
from backend.config import cfg
except FileNotFoundError as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
setup_logging(
level=cfg("server.log_level", "INFO"),
fmt=cfg("server.log_format", "json"),
)
uvicorn.run(
"backend.app:app",
host=cfg("server.host", "0.0.0.0"),
port=cfg("server.port", 5200),
reload=cfg("server.reload", False),
)
if __name__ == "__main__":
main()