@echo off
title Radar Server
cd /d "%~dp0"

echo ================================
echo    RG Radar Server
echo ================================
echo.

set "NODE=node"
if exist "%~dp0node.exe" (
    set "NODE=%~dp0node.exe"
) else (
    where node >nul 2>&1
    if %errorlevel% neq 0 (
        echo [ERROR] node.exe not found!
        pause
        exit /b 1
    )
)

set /p PORT="Port (default 5000): "
if "%PORT%"=="" set PORT=5000

echo.
echo Starting on port %PORT% ...
echo.

set PORT=%PORT%
"%NODE%" server.js

echo.
pause
