ALL requests require a key parameter, eg `reduxblog.herokuapp.com/api/posts?key=123`
| Endpoint | Method | Example | Sample Response | Description |
|---|---|---|---|---|
| /api/posts | GET | http://reduxblog.herokuapp.com/api/posts |
[
{ id: 1,
title: 'Hi!',
categories: 'Computer, Friends',
content: 'Post about Friends'
},
{
id: 2,
title: 'New Post',
categories: 'Candy',
content: 'Post about Candy'
}
]
|
Fetches the 40 most recent posts in the database. Note this list is occasionally cleaned out. |
| /api/posts | POST | http://reduxblog.herokuapp.com/api/posts |
{
id: 1,
title: 'Hi!',
categories: 'Computer, Friends',
content: 'Blog post content'
}
|
Creates a new blog post entry. Returns the created blog post with the ID |
| /api/posts/:id | GET | http://reduxblog.herokuapp.com/api/posts/5 |
{
id: 1,
title: 'Hi!',
categories: 'Computer, Friends',
content: 'Blog post content'
}
|
Fetches a single blog post with the given ID. Includes the blog's content. |
| /api/posts/:id | DELETE | http://reduxblog.herokuapp.com/api/posts/5 |
{
id: 1,
title: 'Hi!',
categories: 'Computer, Friends',
content: 'Blog post content'
}
|
Deletes a single blog post with the given ID. Returns the post |