-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.py
More file actions
48 lines (33 loc) · 1019 Bytes
/
Copy pathrun.py
File metadata and controls
48 lines (33 loc) · 1019 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
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
"""PiNet-OS — Application entry point.
Start the Python backend + frontend server:
python run.py
Or with uvicorn directly:
uvicorn backend.main:app --host 0.0.0.0 --port 3000 --reload
"""
from __future__ import annotations
import os
import sys
import uvicorn
from dotenv import load_dotenv
# Load .env if present
load_dotenv()
def main() -> None:
"""Start the PiNet-OS server."""
from backend.main import create_app
app = create_app()
port = int(os.getenv("PINET_DESKTOP_PORT", "3000"))
host = os.getenv("PINET_HOST", "0.0.0.0")
reload_enabled = os.getenv("PINET_RELOAD", "").lower() in ("1", "true", "yes")
print(f"🚀 PiNet-OS starting on http://{host}:{port}")
print(f" Python {sys.version}")
print(f" Reload: {'enabled' if reload_enabled else 'disabled'}")
uvicorn.run(
app,
host=host,
port=port,
reload=reload_enabled,
log_level="info",
)
if __name__ == "__main__":
main()