-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-api.sh
More file actions
executable file
·44 lines (33 loc) · 958 Bytes
/
test-api.sh
File metadata and controls
executable file
·44 lines (33 loc) · 958 Bytes
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
#!/bin/bash
# Quick API test script
echo "🧪 Testing FastAPI Backend..."
echo ""
# Check if backend is running
if ! curl -s http://localhost:8000 > /dev/null; then
echo "❌ Backend is not running on port 8000"
echo " Start it with: cd backend && source venv/bin/activate && uvicorn main:app --reload"
exit 1
fi
echo "✅ Backend is running"
echo ""
echo "Testing endpoints:"
echo ""
echo "1. GET /api/posts"
curl -s http://localhost:8000/api/posts | python3 -m json.tool | head -20
echo "..."
echo ""
echo "2. GET /api/tags"
curl -s http://localhost:8000/api/tags
echo ""
echo ""
echo "3. GET /api/site-config"
curl -s http://localhost:8000/api/site-config | python3 -m json.tool
echo ""
echo "4. GET /docs (API Documentation)"
echo " Visit: http://localhost:8000/docs"
echo ""
echo "✨ All endpoints responding!"
echo ""
echo "To test the frontend:"
echo " cd frontend && npm run dev"
echo " Visit: http://localhost:3000"