-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_servers.bat
More file actions
66 lines (59 loc) · 1.57 KB
/
start_servers.bat
File metadata and controls
66 lines (59 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@echo off
setlocal enabledelayedexpansion
:: Check if Node.js is installed
where node >nul 2>&1
if NOT %ERRORLEVEL% EQU 0 (
echo ❌ Node.js is not installed.
echo Please run installer.bat to install required packages.
pause
goto :eof
)
echo === Checking backend dependencies ===
if not exist "api\node_modules" (
echo ⚙️ Backend dependencies missing. Running npm_install.bat...
pushd scripts\windows
call npm_install.bat
if ERRORLEVEL 1 (
echo ❌ npm_install.bat failed for backend
pause
popd
goto :eof
)
popd
)
echo === Checking frontend dependencies ===
if not exist "front-end\node_modules" (
echo ⚙️ Frontend dependencies missing. Running npm_install.bat...
pushd scripts\windows
call npm_install.bat
if ERRORLEVEL 1 (
echo ❌ npm_install.bat failed for frontend
pause
popd
goto :eof
)
popd
)
echo ✅ All dependencies installed.
echo Starting backend server...
start "" cmd /k "cd api && npm start"
echo === Checking frontend ===
if exist "front-end\build" (
echo 🟢 Frontend build folder exists. Serving...
start "" cmd /k "cd front-end\build && npx serve"
) else (
echo 🔧 Frontend build folder not found. Building...
pushd front-end
npm run build
popd
if exist "front-end\build" (
echo ✅ Build complete. Serving frontend...
start "" cmd /k "cd front-end\build && npx serve"
) else (
echo ❌ Frontend build failed.
pause
)
)
echo ✅ You can now close this window.
pause
endlocal