-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript-start-dev-https.bat
More file actions
64 lines (54 loc) · 1.68 KB
/
Copy pathscript-start-dev-https.bat
File metadata and controls
64 lines (54 loc) · 1.68 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
@echo off
SETLOCAL
echo ================================
echo HTTPS DEVELOPMENT SERVER
echo For VK ID OAuth Testing
echo ================================
REM Change to project directory first (admin starts in system32)
cd /d C:\Projects\reader.market
REM Check if running as admin (required for port 443)
net session >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: This script requires Administrator privileges for port 443.
echo Please right-click and select "Run as administrator"
pause
exit /b 1
)
REM Kill any existing processes on port 443
echo Stopping any existing processes on port 443...
for /f "tokens=5" %%a in ('netstat -aon ^| findstr :443 ^| findstr LISTENING') do taskkill /f /pid %%a >nul 2>&1
REM Start Docker containers if needed
echo Starting Docker containers...
docker start postgres-db >nul 2>&1 || (
echo PostgreSQL container not found. Please run start-dev.bat first to set up the database.
pause
exit /b 1
)
REM Wait for PostgreSQL to be ready
echo Verifying database connection...
node scripts/db_test.js
if %errorlevel% neq 0 (
echo Database connection failed. Please ensure PostgreSQL is running.
pause
exit /b 1
)
echo Database is ready!
REM Ensure we're in the right directory
cd /d C:\Projects\reader.market
echo.
echo ================================
echo HTTPS SERVER STARTING
echo ================================
echo URL: https://localhost
echo Port: 443 (HTTPS)
echo.
echo VK ID OAuth redirect: https://localhost/auth/callback/vk
echo.
echo Press Ctrl+C to stop the server.
echo ================================
echo.
REM Start the server with HTTPS on port 443
set USE_HTTPS=true
set PORT=443
set APP_URL=https://localhost
npm run dev