deckhearth/api
Randall Stillwell 07b3dda6fa Fix Vercel function request body parsing
🐛 Bug Fix:
- Replace req.json() with req.text() + JSON.parse() for Vercel compatibility
- Add proper error handling for malformed JSON requests
- Fix authentication endpoints (login/register) body parsing
- Fix admin users endpoint body parsing

🔧 Technical Details:
- Vercel functions don't support req.json() method directly
- Use req.text() to get raw body content then parse manually
- Add try/catch blocks for JSON parsing errors
- Maintain same API interface and error responses

 Endpoints Fixed:
- /api/auth/register - User registration
- /api/auth/login - User authentication
- /api/admin/users - Admin user management

This resolves the 'req.json is not a function' error in production.
2025-07-21 21:11:13 -05:00
..
admin Fix Vercel function request body parsing 2025-07-21 21:11:13 -05:00
auth Fix Vercel function request body parsing 2025-07-21 21:11:13 -05:00
v1/cards Fix Node.js 18 compatibility for Vercel deployment 2025-07-21 16:08:45 -05:00
health.ts 🚀 TCG Vault - Complete All-Vercel Setup 2025-07-21 13:53:06 -05:00
migrate.ts Fix Vercel ES module import issues 2025-07-21 16:12:24 -05:00
setup-auth.ts Implement complete user authentication and admin panel system 2025-07-21 21:06:38 -05:00
tsconfig.json Fix Vercel ES module import issues 2025-07-21 16:12:24 -05:00