Files
SystemSimulationApp/start-backend.bat
T

31 lines
595 B
Batchfile

@echo off
setlocal
cd /d "%~dp0"
title SystemSimulationApp FastAPI - 127.0.0.1:8000
set "PYTHON_EXE=%~dp0.venv-win\Scripts\python.exe"
if not exist "%PYTHON_EXE%" (
echo [ERROR] Python virtual environment was not found:
echo %PYTHON_EXE%
echo.
pause
exit /b 1
)
echo Starting FastAPI at http://127.0.0.1:8000
echo Press Ctrl+C to stop the service.
echo.
"%PYTHON_EXE%" -m uvicorn app.main:app --host 127.0.0.1 --port 8000
set "EXIT_CODE=%ERRORLEVEL%"
if not "%EXIT_CODE%"=="0" (
echo.
echo [ERROR] FastAPI exited with code %EXIT_CODE%.
pause
)
exit /b %EXIT_CODE%