21 lines
645 B
Python
21 lines
645 B
Python
"""Entry point cho daw_engine.exe (PyInstaller — spec desktop 2026-08-08).
|
|
Chạy FastAPI backend trên 127.0.0.1:8000 (Dual-Process Desktop Architecture)."""
|
|
import os
|
|
import sys
|
|
import threading
|
|
import webbrowser
|
|
|
|
os.environ.setdefault("SFDATA_DIR", os.path.join(os.path.expanduser("~"), "SonicForgeDAW"))
|
|
|
|
import uvicorn # noqa: E402
|
|
|
|
|
|
def _open_browser():
|
|
webbrowser.open("http://127.0.0.1:8000")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
# Mở browser sau khi server sẵn sàng (console=False — chạy ẩn)
|
|
threading.Timer(2.0, _open_browser).start()
|
|
uvicorn.run("app.main:app", host="127.0.0.1", port=8000, log_level="warning")
|