Bloggy is a centralized blogging platform with posts written in markdown language.
POST - /api/auth/login
request:
{
username: String,
password: String
}
response:
{
authToken: String
}
POST - /api/auth/refresh
request:
{
authToken: String
}
response:
{
authToken: String
}
POST - /api/users
request:
{
username: String,
password: String,
blog: String
}
response:
{
id: String,
username: String,
blog: String
}
GET - /api/users/[username]
response:
{
blog: String
}
GET - /api/users/[username]/posts
response:
[
{
title: String,
content: String,
slug: String,
createdAt: DateString,
updatedAt: DateString
},
...
]
GET - /api/users/[username]/[slug]
response:
{
title: String,
content: String,
slug: String,
createdAt: DateString,
updatedAt: DateString
}
POST - /api/posts
request:
{
headers: {
authorization: 'Bearer [token]'
},
body: {
title: String,
slug: String,
content: String
}
}
response:
{
status: 201,
body: {
title: String,
content: String,
slug: String,
createdAt: DateString,
updatedAt: DateString
}
}
POST - /api/comments
request:
{
headers: {
authorization: 'Bearer [token]'
},
body: {
content: String,
postId: String
}
}
response:
{
status: 201,
body: {
id: String,
content: String,
userId: String,
postId: String,
createdAt: DateString,
updatedAt: DateString
}
}
GET - /api/comments/[username]/[slug]
response:
[
{
id: String,
content: String,
userId: {
username: String
},
postId: String,
createdAt: DateString,
updatedAt: DateString
}
]
Built with
MIT © Hiram Cruz 2018