46 lines
1.2 KiB
Batchfile
46 lines
1.2 KiB
Batchfile
@echo off
|
|
setlocal enabledelayedexpansion
|
|
|
|
echo [%date% %time%] Starte Frontend-Debug-Server...
|
|
|
|
REM Pfad zum Debug-Server ermitteln
|
|
set "SCRIPT_DIR=%~dp0"
|
|
set "DEBUG_SERVER_DIR=%SCRIPT_DIR%debug-server"
|
|
|
|
REM Prüfe, ob das Debug-Server-Verzeichnis existiert
|
|
if not exist "%DEBUG_SERVER_DIR%" (
|
|
echo [%date% %time%] FEHLER: Debug-Server-Verzeichnis nicht gefunden: %DEBUG_SERVER_DIR%
|
|
exit /b 1
|
|
)
|
|
|
|
REM Prüfe, ob Node.js installiert ist
|
|
where node >nul 2>&1
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo [%date% %time%] FEHLER: Node.js nicht gefunden. Bitte installieren Sie Node.js.
|
|
exit /b 1
|
|
)
|
|
|
|
REM Prüfe, ob npm installiert ist
|
|
where npm >nul 2>&1
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo [%date% %time%] FEHLER: npm nicht gefunden. Bitte installieren Sie npm.
|
|
exit /b 1
|
|
)
|
|
|
|
REM Wechsle ins Debug-Server-Verzeichnis
|
|
cd "%DEBUG_SERVER_DIR%"
|
|
|
|
REM Installiere Abhängigkeiten, falls nötig
|
|
if exist "package.json" (
|
|
echo [%date% %time%] Installiere Abhängigkeiten...
|
|
npm install
|
|
)
|
|
|
|
REM Erstelle benötigte Verzeichnisse, falls sie nicht existieren
|
|
if not exist "public\views" mkdir "public\views"
|
|
|
|
REM Starte den Debug-Server
|
|
echo [%date% %time%] Starte Frontend-Debug-Server...
|
|
node src\app.js
|
|
|
|
endlocal |