1+ #! /bin/bash
2+
3+ # MarketMap API Endpoint Testing Script
4+ # Make sure your backend server is running on localhost:8000
5+
6+ BASE_URL=" http://localhost:8000"
7+ echo " Testing MarketMap API endpoints..."
8+ echo " Base URL: $BASE_URL "
9+ echo " ==========================================="
10+
11+ # Test 1: Root endpoint
12+ echo " \n1. Testing root endpoint..."
13+ curl -s -w " \nStatus: %{http_code}\n" " $BASE_URL /"
14+
15+ # Test 2: Debug environment endpoint
16+ echo " \n2. Testing debug environment..."
17+ curl -s -w " \nStatus: %{http_code}\n" " $BASE_URL /debug/env"
18+
19+ # Test 3: Indices status endpoint (the one that was failing)
20+ echo " \n3. Testing indices status endpoint..."
21+ curl -s -w " \nStatus: %{http_code}\n" " $BASE_URL /api/indices/status"
22+
23+ # Test 4: Last updated endpoint
24+ echo " \n4. Testing last updated endpoint..."
25+ curl -s -w " \nStatus: %{http_code}\n" " $BASE_URL /api/indices/last-updated"
26+
27+ # Test 5: All indices endpoint
28+ echo " \n5. Testing all indices endpoint..."
29+ curl -s -w " \nStatus: %{http_code}\n" " $BASE_URL /api/indices"
30+
31+ # Test 6: Specific index endpoints (common market indices)
32+ echo " \n6. Testing specific index endpoints..."
33+ INDICES=(" ^GSPC" " ^DJI" " ^IXIC" " ^FTSE" " ^N225" )
34+
35+ for index in " ${INDICES[@]} " ; do
36+ echo " \n Testing $index ..."
37+ curl -s -w " \nStatus: %{http_code}\n" " $BASE_URL /api/indices/$index "
38+ done
39+
40+ # Test 7: Health check with detailed output
41+ echo " \n7. Detailed health check..."
42+ echo " Testing with verbose output:"
43+ curl -v " $BASE_URL /api/indices/status" 2>&1 | head -20
44+
45+ echo " \n==========================================="
46+ echo " Testing complete!"
47+ echo " \nIf you see 500 errors, check:"
48+ echo " 1. MongoDB connection (MONGODB_URI environment variable)"
49+ echo " 2. Backend server logs for detailed error messages"
50+ echo " 3. SSL/TLS configuration in dependencies.py"
0 commit comments