Intermediate
api
backend
Design a REST endpoint
Well-structured API routes. Tuned for ChatGPT.
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]. If anything is unclear, state your assumptions before answering.
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.
