← Back to list

api-endpoint-design
by MSBart2
repo for training labs/exercises/walk-throughs
⭐ 0🍴 0📅 Jan 23, 2026
SKILL.md
name: api-endpoint-design description: REST API design standards for FanHub's Express backend. Use when creating or modifying API endpoints to ensure consistency.
FanHub API Design Standards
URL Conventions
- Use lowercase, hyphenated paths:
/api/tv-shows, not/api/tvShows - Use plural nouns for collections:
/api/characters, not/api/character - Use nested routes for relationships:
/api/shows/:showId/episodes - Version the API:
/api/v1/...
HTTP Methods
| Method | Use Case | Example |
|---|---|---|
| GET | Retrieve resource(s) | GET /api/characters |
| POST | Create new resource | POST /api/characters |
| PUT | Replace entire resource | PUT /api/characters/:id |
| PATCH | Partial update | PATCH /api/characters/:id |
| DELETE | Remove resource | DELETE /api/characters/:id |
Response Format
All responses follow this structure:
{
"success": true,
"data": { ... },
"meta": {
"total": 100,
"page": 1,
"limit": 20
}
}
Error responses:
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Character name is required",
"details": [...]
}
}
Status Codes
- 200: Success (GET, PUT, PATCH)
- 201: Created (POST)
- 204: No Content (DELETE)
- 400: Bad Request (validation errors)
- 401: Unauthorized
- 404: Not Found
- 500: Internal Server Error
Endpoint Template
router.get('/characters', async (req, res, next) => {
try {
const { page = 1, limit = 20, show_id } = req.query;
const characters = await CharacterService.list({
page: parseInt(page),
limit: parseInt(limit),
showId: show_id ? parseInt(show_id) : undefined
});
res.json({
success: true,
data: characters.items,
meta: {
total: characters.total,
page: characters.page,
limit: characters.limit
}
});
} catch (error) {
next(error);
}
});
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon