mirror of
https://github.com/zhouxiaoka/autoclip.git
synced 2026-09-03 06:24:14 +08:00
Squashed merge of fix/problem-fixes-from-main. - Desktop client (Tauri v2) wiring + packaging - CI workflow updates (Python 3.11, Rust toolchain, Tauri CLI, WebKit deps) - Backend test fix (test_missing_api_key respects CI-injected env var) - build_backend.py: support CI without venv + Windows-safe ASCII output Desktop build workflows (Linux/Windows/macOS) still failing — tracked in #65.
29 lines
767 B
Python
29 lines
767 B
Python
"""FastAPI应用入口点 - Web模式"""
|
|
|
|
import logging
|
|
from backend.app_factory import create_app
|
|
|
|
# 创建应用实例
|
|
app = create_app(mode="web")
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
import sys
|
|
|
|
# 默认端口
|
|
port = 8000
|
|
|
|
# 检查命令行参数
|
|
if len(sys.argv) > 1:
|
|
for i, arg in enumerate(sys.argv):
|
|
if arg == "--port" and i + 1 < len(sys.argv):
|
|
try:
|
|
port = int(sys.argv[i + 1])
|
|
except ValueError:
|
|
logger.error(f"无效的端口号: {sys.argv[i + 1]}")
|
|
port = 8000
|
|
|
|
logger.info(f"启动服务器,端口: {port}")
|
|
uvicorn.run(app, host="0.0.0.0", port=port) |