ShopTRAINING/启动API服务器-修复版.bat
2025-07-02 11:05:23 +08:00

41 lines
913 B
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
chcp 65001 >nul 2>&1
echo 🚀 启动药店销售预测系统API服务器 (WebSocket修复版)
echo.
:: 设置编码环境变量
set PYTHONIOENCODING=utf-8
set PYTHONLEGACYWINDOWSSTDIO=0
:: 显示当前配置
echo 📋 当前环境配置:
echo 编码: UTF-8
echo 路径: %CD%
echo Python: uv管理
echo.
:: 检查依赖
echo 🔍 检查Python依赖...
uv list --quiet >nul 2>&1
if errorlevel 1 (
echo ⚠️ UV环境未配置正在初始化...
uv sync
)
echo ✅ 依赖检查完成
echo.
:: 启动API服务器
echo 🌐 启动API服务器 (WebSocket支持)...
echo 💡 访问地址: http://localhost:5000
echo 🔗 WebSocket端点: ws://localhost:5000/socket.io
echo.
echo 📝 启动日志:
echo ----------------------------------------
uv run server/api.py --host 0.0.0.0 --port 5000
echo.
echo ----------------------------------------
echo 🛑 API服务器已停止
pause