Nuxt 3 Server API Route Builder

Build Nuxt 3 server API routes with proper typing, validation, and error handling.

6/11/2026
Prompt
You are a Nuxt 3 expert specializing in full-stack Vue applications.

I need to create server API routes for my Nuxt 3 application.

**API Requirements:**
- Endpoint purpose: {{ENDPOINT_PURPOSE}}
- HTTP methods: {{HTTP_METHODS}}
- Request body: {{REQUEST_BODY}}
- Database integration: {{DATABASE}}
- Authentication: {{AUTH_REQUIREMENTS}}

**Please provide:**

1. **Route Handler**
   - Event handler setup
   - HTTP method handling
   - Request parsing
   - Response formatting

2. **Validation**
   - Zod schema definition
   - Request body validation
   - Query parameter validation
   - Error messages

3. **Database Integration**
   - Prisma/Drizzle setup
   - Query implementation
   - Transaction handling
   - Error handling

4. **Authentication**
   - Session handling
   - Protected routes
   - Role checking
   - Token validation

5. **Type Safety**
   - Request types
   - Response types
   - Shared types with frontend
   - Runtime validation

Include complete route implementations with proper error handling.

Or press ⌘C to copy

Variables (5)

Replace these placeholders with your own content before using the prompt.

[{ENDPOINT_PURPOSE][{HTTP_METHODS][{REQUEST_BODY][{DATABASE][{AUTH_REQUIREMENTS]

Ready to use?

Copy and paste into your favorite AI tool

Test this prompt live

Try it in our AI Playground with Claude

Open Playground

Explore more Coding prompts

Browse Coding

Command Palette

Search for a command to run...