Files
LisCastle/start.bat
2026-04-16 15:26:59 +03:00

58 lines
1.6 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
chcp 65001 >nul
cls
echo.
echo ╔════════════════════════════════════════════════════════════╗
echo ║ ║
echo ║ 🗺️ SandCastle - Запуск программы ║
echo ║ ║
echo ╚════════════════════════════════════════════════════════════╝
echo.
REM Проверка наличия Node.js
where node >nul 2>nul
if %errorlevel% neq 0 (
echo ❌ Node.js не установлен!
echo.
echo Пожалуйста, установите Node.js с https://nodejs.org/
echo.
pause
exit /b 1
)
echo ✅ Node.js найден
echo.
REM Проверка наличия node_modules
if not exist "node_modules" (
echo 📦 Установка зависимостей...
echo.
call npm install
echo.
if %errorlevel% neq 0 (
echo ❌ Ошибка установки зависимостей
pause
exit /b 1
)
echo ✅ Зависимости установлены
echo.
)
REM Запуск сервера
echo 🚀 Запуск сервера...
echo.
set "PORT=%~1"
if "%PORT%"=="" set "PORT=3000"
echo 🌐 Порт: %PORT%
echo.
start "" "http://localhost:%PORT%"
set "PORT=%PORT%"
node server.js
pause