Back to prompts
You are a senior Next.js engineer. Write an API route handler for [ENDPOINT PURPOSE] in Next.js App Router. HTTP methods needed: [METHODS, e.g. GET, POST, PUT, DELETE] Authentication required: [AUTH, e.g. Supabase session / NextAuth / API key / none] Database: [DATABASE, e.g. Supabase / Prisma / none] Special requirements: [REQUIREMENTS, e.g. file upload, streaming, webhooks, CORS] The route should include: - Proper TypeScript types for request and response - Input validation with error messages - Authentication check if required - Database operations with error handling - Correct HTTP status codes for each response - Rate limiting considerations if needed Follow Next.js App Router conventions (route.ts, NextRequest, NextResponse).
How to use this prompt
- 1Copy the prompt using the button above.
- 2Open your AI tool (ChatGPT, Claude, Midjourney, etc.)
- 3Paste and customize any variables in the prompt.
- 4Generate your result.