31 lines
1.1 KiB
Batchfile
31 lines
1.1 KiB
Batchfile
@echo off
|
|||
|
|
chcp 65001 >nul
|
||
|
|
REM ===================================================================
|
||
|
|
REM OPTIONAL - standalone frontend server on http://127.0.0.1:5500
|
||
|
|
REM
|
||
|
|
REM You normally do NOT need this: the backend already serves the UI
|
||
|
|
REM at http://127.0.0.1:8004/ .
|
||
|
|
REM
|
||
|
|
REM Use it only when you want to edit frontend/index.html and refresh
|
||
|
|
REM without restarting the backend. Port 5500 is whitelisted in the
|
||
|
|
REM backend .env CORS_ORIGINS, so the page can still reach the API.
|
||
|
|
REM ===================================================================
|
||
|
|
|
||
|
|
cd /d "%~dp0"
|
||
|
|
|
||
|
|
set "PY=python"
|
||
|
|
if exist "%~dp0..\.venv\Scripts\python.exe" set "PY=%~dp0..\.venv\Scripts\python.exe"
|
||
|
|
if exist "%~dp0..\student_management_system\.venv\Scripts\python.exe" set "PY=%~dp0..\student_management_system\.venv\Scripts\python.exe"
|
||
|
|
|
||
|
|
echo.
|
||
|
|
echo Frontend only : http://127.0.0.1:5500
|
||
|
|
echo Needs the backend running at http://127.0.0.1:8004
|
||
|
|
echo Or just use http://127.0.0.1:8004/ directly and skip this.
|
||
|
|
echo.
|
||
|
|
|
||
|
|
"%PY%" -m http.server 5500 --bind 127.0.0.1
|
||
|
|
|
||
|
|
echo.
|
||
|
|
echo [!] Frontend stopped. exit code = %ERRORLEVEL%
|
||
|
|
pause
|