Create a robust API route handler with validation, error handling, and proper TypeScript types.
Create a Next.js App Router API route handler with the following features:
Endpoint: {{method}} /api/{{endpoint}}
Requirements:
1. Use Zod for request body/query validation
2. Implement proper error handling with meaningful error messages
3. Return appropriate HTTP status codes
4. Add rate limiting consideration comments
5. Include proper TypeScript types for request and response
6. Log errors to console with structured logging format
7. Handle edge cases (empty body, malformed JSON, etc.)No add-ons yet.
No notes yet.