#!/nix/store/ypgcdmzzlgnrmdcsq72c3dxz651jg9zc-bash-5.3p3/bin/bash # Start the server in the background ./markdown-editor --data-dir ./test/data --port 8081 --host 127.0.0.1 & SERVER_PID=$! # Give the server time to start sleep 2 # Test the /api/files endpoint echo "Testing GET /api/files..." response=$(curl -s http://127.0.0.1:8081/api/files) echo "Response: $response" echo "" # Test if it's valid JSON if echo "$response" | python3 -m json.tool > /dev/null 2>&1; then echo "✓ Response is valid JSON" else echo "✗ Response is NOT valid JSON" echo "Response was: $response" fi # Kill the server kill $SERVER_PID 2>/dev/null wait $SERVER_PID 2>/dev/null echo "Test completed"