-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun_server.py
More file actions
34 lines (26 loc) · 773 Bytes
/
Copy pathrun_server.py
File metadata and controls
34 lines (26 loc) · 773 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
#!/usr/bin/env python3
"""
Entry point for PyInstaller executable.
Starts the uvicorn server programmatically.
"""
import os
import sys
def main():
# Change to executable directory for relative paths (config, database)
if getattr(sys, "frozen", False):
os.chdir(os.path.dirname(sys.executable))
# Import uvicorn and app after path setup
import uvicorn
from app.main import app
# Run the server
# Use httptools instead of h11 to avoid h11 state machine issues
# (h11 0.16.0 has stricter state handling that can cause errors)
uvicorn.run(
app,
host="0.0.0.0",
port=80,
log_level="info",
http="httptools",
)
if __name__ == "__main__":
main()