@echo off
echo 🧪 Testing API endpoints...
echo.

echo 📚 Testing /api/books:
curl -s http://localhost:8080/api/books | findstr "id"
if %errorlevel% equ 0 (
    echo ✅ API /api/books works!
) else (
    echo ❌ API /api/books failed!
)

echo.
echo 📄 Testing JSON file access:
curl -s http://localhost:8080/src/chapters/sbs.json | findstr "name"
if %errorlevel% equ 0 (
    echo ✅ JSON file access works!
) else (
    echo ❌ JSON file access failed!
)

echo.
echo 🏠 Testing homepage:
curl -s http://localhost:8080/ | findstr "currentBookId"
if %errorlevel% equ 0 (
    echo ✅ Dynamic frontend loaded!
) else (
    echo ❌ Frontend issue!
)

pause