What problem does it solve?
This Skill addresses the challenge of maintaining consistent and secure API route conventions across different projects, ensuring a high standard of code quality and security.
Core Features & Use Cases
- REST-only Routes: Enforces the use of REST for API routes, simplifying client-server communication.
- File Layout: Defines clear file paths for list and detail endpoints, enhancing code organization.
- Auth Guard Order: Outlines the correct sequence for authentication checks to ensure secure access control.
- CORS Rules: Provides guidelines for handling Cross-Origin Resource Sharing to maintain security.
- Health Check Endpoint: Offers a standardized health-check endpoint for application monitoring.
- Use Case: Implement this Skill to structure your Next.js API routes following best practices, ensuring your API is secure and maintainable.
Quick Start
Implement the API route conventions for your Next.js application by following the outlined file layout and authentication sequence in your src/app/api/ directory.