POST /register
Create a new user account.
{
"Username": "example_user",
"Password": "example_password"
}
POST /login
Authenticate and log in a user.
{
"Username": "example_user",
"Password": "example_password"
}
POST /logout
Log out the currently authenticated user.
"Thanks for visiting."
GET /profile
Retrieve the profile of the currently authenticated user.
{
"Username": "authenticated_user",
"id": "user_id",
}
POST /post
Create a new blog post.
{
"title": "Example Title",
"summary": "Brief summary of the blog post",
"content": "Main content of the blog post",
"file": "Image file for the blog post"
}
GET /post
Retrieve a list of all blog posts.
[
{
"_id": "Blog post ID 1",
"title": "Example Title 1",
"summary": "Brief summary of the blog post 1",
"content": "Main content of the blog post 1",
"cover": "Path to the cover image 1",
"author": "Author ID 1",
"createdAt": "Timestamp of creation 1",
"updatedAt": "Timestamp of last update 1"
},
{
"_id": "Blog post ID 2",
"title": "Example Title 2",
"summary": "Brief summary of the blog post 2",
"content": "Main content of the blog post 2",
"cover": "Path to the cover image 2",
"author": "Author ID 2",
"createdAt": "Timestamp of creation 2",
"updatedAt": "Timestamp of last update 2"
},
// more blog post response objects ....
]
GET /post/:id
Retrieve details of a specific blog post by ID.
{
"_id": "Blog post ID",
"title": "Example Title",
"summary": "Brief summary of the blog post",
"content": "Main content of the blog post",
"cover": "Path to the cover image",
"author": "Author ID",
"createdAt": "Timestamp of creation",
"updatedAt": "Timestamp of last update"
}
PUT /post
Update details of an existing blog post.
{
"id": "Blog post ID",
"title": "Updated Title",
"summary": "Updated summary",
"content": "Updated content",
"file": "Updated image file"
}