Spaces:
Running
Running
| @echo off | |
| REM Version: v5 | |
| REM ============================================ | |
| REM SBN Mentors Invoice & Sessions Application | |
| REM Batch file to run the app | |
| REM ============================================ | |
| setlocal enabledelayedexpansion | |
| REM Get the current directory | |
| set APP_DIR=%~dp0 | |
| REM Check if Python is available for running a local server (optional) | |
| where python >nul 2>nul | |
| if %ERRORLEVEL% EQU 0 ( | |
| echo Python found. Starting local HTTP server... | |
| echo. | |
| echo Starting server on http://localhost:8000 | |
| echo Press Ctrl+C to stop the server | |
| echo. | |
| REM Change to app directory and start Python HTTP server | |
| cd /d "%APP_DIR%" | |
| python -m http.server 8000 | |
| ) else ( | |
| echo Python not found. Opening index.html directly... | |
| echo. | |
| REM Open the index.html file directly in the default browser | |
| set INDEX_FILE=%APP_DIR%index.html | |
| if exist "!INDEX_FILE!" ( | |
| start "" "!INDEX_FILE!" | |
| echo App opened in your default browser. | |
| ) else ( | |
| echo Error: index.html not found in %APP_DIR% | |
| pause | |
| ) | |
| ) | |
| endlocal | |
| pause | |