✨ api
This commit is contained in:
32
README.md
32
README.md
@@ -224,6 +224,38 @@ For larger comic archives, consider replacing the `COMICS` list with a database:
|
||||
- `/about` - About the comic and author
|
||||
- `/static/feed.rss` - RSS feed
|
||||
|
||||
## API Endpoints
|
||||
|
||||
The app exposes a JSON API for programmatic access:
|
||||
|
||||
- **GET `/api/comics`** - Returns all comics as a JSON array
|
||||
```json
|
||||
[
|
||||
{
|
||||
"number": 1,
|
||||
"title": "First Comic",
|
||||
"filename": "comic-001.png",
|
||||
"date": "2025-01-01",
|
||||
"alt_text": "The very first comic",
|
||||
"author_note": "This is where your comic journey begins!"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
- **GET `/api/comics/<id>`** - Returns a specific comic as JSON
|
||||
```json
|
||||
{
|
||||
"number": 1,
|
||||
"title": "First Comic",
|
||||
"filename": "comic-001.png",
|
||||
"date": "2025-01-01",
|
||||
"alt_text": "The very first comic",
|
||||
"author_note": "This is where your comic journey begins!"
|
||||
}
|
||||
```
|
||||
|
||||
Returns 404 with `{"error": "Comic not found"}` if the comic doesn't exist.
|
||||
|
||||
## License
|
||||
|
||||
[Add your license here]
|
||||
|
||||
Reference in New Issue
Block a user