-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_api.py
More file actions
28 lines (23 loc) · 758 Bytes
/
Copy pathrun_api.py
File metadata and controls
28 lines (23 loc) · 758 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
"""
run_api.py
Why this file exists
---------------------
A single, obvious entry point at the project root so `python run_api.py`
starts the backend without needing to remember the uvicorn module path.
Equivalent to running:
uvicorn backend.api.main:app --host 0.0.0.0 --port 8000
How it connects to the system
------------------------------
Imports the FastAPI `app` from backend/api/main.py and serves it with
uvicorn, using host/port from backend/config/settings.py.
"""
import uvicorn
from backend.config.settings import settings
if __name__ == "__main__":
uvicorn.run(
"backend.api.main:app",
host=settings.api_host,
port=settings.api_port,
reload=False,
log_level=settings.log_level.lower(),
)