Commit graph

2 commits

Author SHA1 Message Date
Randall Stillwell
323d6a3dd3 Add health check and improve database test endpoint
🔧 Improvements:
- Add /api/health endpoint for basic API functionality testing
- Improve /api/test-db with timeout handling and better error reporting
- Add environment variable checks before database operations
- Add connection timeouts to prevent function timeouts
- Better error handling and logging

🧪 Testing Endpoints:
- /api/health - Simple API health check (no DB required)
- /api/test-db - Database connectivity test with timeout protection

These changes should help identify whether the issue is with API routing, environment variables, or database connectivity.
2025-07-22 06:36:13 -05:00
Randall Stillwell
0531f25cbb Add debugging tools and optimize auth endpoints
🔧 Debugging Improvements:
- Optimize setup-auth endpoint to avoid timeouts
- Add table existence checks before operations
- Simplify permission system for faster setup
- Add environment variable validation
- Create test-db endpoint for connection debugging

🚀 Performance Optimizations:
- Break down large SQL queries into smaller chunks
- Add early returns for already-setup scenarios
- Reduce permission complexity during initial setup
- Better error messages for troubleshooting

🧪 New Debug Endpoints:
- /api/test-db - Test database connectivity
- /api/setup-auth - Optimized schema setup

These changes should resolve timeout issues and provide better debugging information for authentication problems.
2025-07-21 21:39:08 -05:00