diff --git a/README.md b/README.md index 6dd13e7..d49a116 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,64 @@ bun run dev ``` open http://localhost:3000 + +## Endpoints + +### Get all items +``` +GET /api/wishlist +``` + +### Add an item +``` +POST /api/wishlist +Content-Type: application/json +``` + +**Body:** +```json +{ + "item": "Nintendo Switch", + "link": "https://amazon.com/...", + "price": 29999, + "priority": 1, + "category": "gaming", + "notes": "OLED version please!" +} +``` + +| Field | Type | Required | +|-------|------|----------| +| `item` | string | ✅ | +| `link` | string | ❌ | +| `price` | number | ❌ | +| `priority` | number | ❌ | +| `category` | string | ❌ | +| `notes` | string | ❌ | + +### Claim an item +``` +PATCH /api/wishlist/:id/claim +``` + +### Delete an item +``` +DELETE /api/wishlist/:id +``` + +## Quick Examples + +```bash +# Add item +curl -X POST http://localhost:3000/api/wishlist \ + -H "content-type: application/json" \ + -d '{"item":"PS5", "category":"gaming", "priority":1}' + +# List all +curl http://localhost:3000/api/wishlist + +# Claim item 1 +curl -X PATCH http://localhost:3000/api/wishlist/1/claim + +# Delete item 1 +curl -X DELETE http://localhost:3000/api/wishlist/1