-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathstart.bat
More file actions
48 lines (42 loc) · 1.1 KB
/
Copy pathstart.bat
File metadata and controls
48 lines (42 loc) · 1.1 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
@echo off
title NESTeq Community
echo.
echo NESTeq Community
echo =================
echo.
:: Check Node.js
where node >nul 2>nul
if %errorlevel% neq 0 (
echo ERROR: Node.js not found.
echo Download it from https://nodejs.org ^(LTS version^)
echo.
echo Press any key to exit...
pause >nul
exit /b 1
)
:: Install dependencies if needed
if not exist "node_modules" (
echo Installing dependencies ^(first time only^)...
npm install --production 2>nul
echo Done.
echo.
)
:: Check port
netstat -ano 2>nul | findstr ":3456.*LISTENING" >nul 2>nul
if %errorlevel% equ 0 (
echo Port 3456 is already in use.
echo NESTeq Community might already be running.
echo Opening browser...
start http://localhost:3456
echo.
echo Press any key to exit...
pause >nul
exit /b 0
)
echo Starting dashboard on http://localhost:3456
echo Press Ctrl+C to stop.
echo.
:: Open browser after server has time to start
start /b cmd /c "timeout /t 3 /nobreak >nul && start http://localhost:3456"
:: Run the server (blocks until Ctrl+C)
node local-agent.js