Self-contained zip (dist/avtoambor-deploy.zip) for end users on Windows 7: double-click install.bat to install Node 16, then start.bat to launch the server. start.bat self-relaunches minimized so the console window stays out of the way. Node is pinned to 16.x and several deps downgraded for Win7 compatibility; the unsupported View Transitions hook is dropped from the root layout. make bundle wraps scripts/make-bundle.sh. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
43 lines
1.1 KiB
Batchfile
43 lines
1.1 KiB
Batchfile
@echo off
|
||
REM Start the Zamena Masla GP server on http://localhost:3000.
|
||
if not "%ZMGP_MINIMIZED%"=="1" (
|
||
set ZMGP_MINIMIZED=1
|
||
start "Zamena Masla GP" /min "%~f0" %*
|
||
exit /b
|
||
)
|
||
chcp 65001 >nul
|
||
|
||
setlocal
|
||
cd /d "%~dp0"
|
||
|
||
set "NODE_EXE=%ProgramFiles%\nodejs\node.exe"
|
||
if not exist "%NODE_EXE%" set "NODE_EXE=%ProgramFiles(x86)%\nodejs\node.exe"
|
||
if not exist "%NODE_EXE%" (
|
||
echo Node.js не найден. Сначала запустите install.bat.
|
||
pause
|
||
exit /b 1
|
||
)
|
||
|
||
if not exist "data\avtoambor.db" (
|
||
echo База данных не найдена — создаём пустую...
|
||
if not exist "data" mkdir data
|
||
"%NODE_EXE%" scripts\init-db.js
|
||
if errorlevel 1 (
|
||
echo Не удалось создать базу данных.
|
||
pause
|
||
exit /b 1
|
||
)
|
||
)
|
||
|
||
set "NODE_ENV=production"
|
||
set "PORT=3000"
|
||
set "HOST=0.0.0.0"
|
||
set "ORIGIN=http://localhost:3000"
|
||
|
||
start "" http://localhost:3000
|
||
|
||
echo Сервер запущен на http://localhost:3000
|
||
echo Закройте это окно, чтобы остановить программу.
|
||
"%NODE_EXE%" build\index.js
|
||
endlocal
|