File size: 2,182 Bytes
cce8120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/env bash
set -euo pipefail

ROOT=/root/projects/website-builder-backend-clean
cd "$ROOT"

HOST=127.0.0.1
PORT=8000

echo "========================================"
echo "Dolor3V Runtime Endpoint Validation"
echo "========================================"

cleanup() {
    if [[ -n "${UVICORN_PID:-}" ]] && kill -0 "$UVICORN_PID" 2>/dev/null; then
        echo
        echo "[CLEANUP] Stopping Uvicorn..."
        kill "$UVICORN_PID" || true
        wait "$UVICORN_PID" 2>/dev/null || true
    fi
}
trap cleanup EXIT

echo
echo "[1/10] Compile"
python3 -m py_compile backend/main.py

echo
echo "[2/10] Start FastAPI"

python3 -m uvicorn backend.main:app \
    --host "$HOST" \
    --port "$PORT" \
    >/tmp/dolor3v_uvicorn.log 2>&1 &

UVICORN_PID=$!

echo
echo "[3/10] Wait for startup"

READY=0

for i in $(seq 1 30); do
    if curl -fs "http://$HOST:$PORT/health" >/dev/null 2>&1; then
        READY=1
        break
    fi
    sleep 1
done

if [[ "$READY" -ne 1 ]]; then
    echo
    echo "========== UVICORN LOG =========="
    cat /tmp/dolor3v_uvicorn.log
    exit 1
fi

echo "[OK] Server started."

echo
echo "[4/10] /health"
curl -fs "http://$HOST:$PORT/health"
echo

echo
echo "[5/10] /openapi.json"
curl -fs "http://$HOST:$PORT/openapi.json" >/dev/null
echo "[OK] OpenAPI available."

echo
echo "[6/10] /mcp"
curl -s \
    -X POST \
    "http://$HOST:$PORT/mcp" \
    -H "Content-Type: application/json" \
    -d '{}' || true
echo

echo
echo "[7/10] Workspace session"
curl -s \
    -X POST \
    "http://$HOST:$PORT/api/workspace/session" \
    -H "Content-Type: application/json" \
    -d '{}' || true
echo

echo
echo "[8/10] Workspace sessions"
curl -s \
    "http://$HOST:$PORT/api/workspace/sessions" || true
echo

echo
echo "[9/10] IDE search"
curl -s \
    "http://$HOST:$PORT/api/ide/search?q=test" || true
echo

echo
echo "[10/10] Chat endpoint"
curl -s \
    -X POST \
    "http://$HOST:$PORT/api/workspace/chat/message" \
    -H "Content-Type: application/json" \
    -d '{"message":"hello"}' || true
echo

echo
echo "========================================"
echo "Dolor3V Runtime Validation Completed"
echo "========================================"