Intermediate
api
backend
Design a REST endpoint
Well-structured API routes. Tuned for Cursor.
Prompt
Design a REST endpoint in [LANGUAGE/FRAMEWORK] to [PURPOSE]. Include route, method, request validation, response shape, error codes, and an example test. Data model: [MODEL]. Work across the relevant files in my codebase and show diffs.
Replace the [HIGHLIGHTED] parts with your own details.
Example output
A typed handler with validation, 200/400/404 responses and a test file.
Tips
- Specify your validation library to match your stack.
