oilverse-api / 启动油界.bat
孙家明
deploy: OilVerse for HuggingFace (Node.js 18 fix)
fab9847
@echo off
title OilVerse Launcher
color 0A
echo.
echo ====================================================
echo OilVerse - One Click Launcher
echo ====================================================
echo.
cd /d "%~dp0"
set "PYTHONUTF8=1"
set "OILVERSE_ROOT=%cd%"
python --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Python not found
pause
exit /b 1
)
node --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Node.js not found
pause
exit /b 1
)
echo [0/3] Cleaning up old processes ...
for /f "tokens=5" %%a in ('netstat -aon 2^>nul ^| findstr ":8765.*LISTENING"') do (
taskkill /f /pid %%a >nul 2>&1
)
for /f "tokens=5" %%a in ('netstat -aon 2^>nul ^| findstr ":5173.*LISTENING"') do (
taskkill /f /pid %%a >nul 2>&1
)
timeout /t 2 /nobreak >nul
echo [1/3] Starting API server (port 8765) ...
start "OilVerse-API" /D "%OILVERSE_ROOT%" cmd /k "set "PYTHONUTF8=1" & python api_server.py"
timeout /t 5 /nobreak >nul
echo [2/3] Starting frontend (port 5173) ...
start "OilVerse-Frontend" /D "%OILVERSE_ROOT%\frontend" cmd /k "npm run dev"
timeout /t 5 /nobreak >nul
echo [3/3] Opening browser ...
start http://localhost:5173
echo.
echo ====================================================
echo DONE!
echo Frontend: http://localhost:5173
echo API: http://localhost:8765
echo ====================================================
echo.
pause