import os
import webbrowser


def main() -> None:
    port = int(os.environ.get("PORT", "7860"))
    url = f"http://127.0.0.1:{port}/"
    print(f"Starting НадTavern on {url}")
    try:
        # Open browser after server is up. We'll rely on .bat to start uvicorn and then open UI.
        webbrowser.open(url)
    except Exception:
        pass


if __name__ == "__main__":
    main()


