This routes allows you to perform CRUD operations on an user.
Method: POST
Route: /upload/avatar
Description: Uploads a new avatar image for the user.
Headers: An authorization token is required to use this route.
Request Body: A file (newFile
) containing the avatar image.
Method: GET
Route: /users/:userId/avatars/:filename
Description: Retrieves the specified avatar image for the user.
Path Parameters:
userId
: The id of the user.filename
: The name of the file.
Method: PUT
Route: /update-avatar/:oldFilename
Description: Updates the specified avatar image for the user.
Headers: An authorization token is required to use this route.
Path Parameters:
oldFilename
: The name of the file to be updated.
Request Body: A file (newFile
) containing the new avatar image.
Method: DELETE
Route: /delete/avatars/:filename
Description: Deletes the specified avatar image for the user.
Headers: An authorization token is required to use this route.
Path Parameters:
filename
: The name of the file to be deleted.
Method: DELETE
Route: /delete-user
Description: Deletes all images for the user.
Headers: An authorization token is required to use this route.
This routes allows you to perform CRUD operations on a blog.
Method: POST
Route: /upload/blog/:blogId/cover
Description: Uploads a new cover image for the blog.
Headers: An authorization token is required to use this route.
Path Parameters:
blogId
: The id of the blog.
Request Body: A file (newCoverImg
) containing the cover image.
Method: GET
Route: /users/:userId/blogs/:blogId/covers/:filename
Description: Retrieves the specified cover image for the blog.
Path Parameters:
userId
: The id of the user.blogId
: The id of the blog.filename
: The name of the file.
Method: PUT
Route: /update/blogs/:blogId/covers/:oldFilename
Description: Updates the specified cover image for the blog.
Headers: An authorization token is required to use this route.
Path Parameters:
blogId
: The id of the blog.oldFilename
: The name of the file to be updated.
Request Body: A file (newCoverImg
) containing the new cover image.
Method: DELETE
Route: /delete/blogs/:blogId/covers/:filename
Description: Deletes the specified cover image for the blog.
Headers: An authorization token is required to use this route.
Path Parameters:
blogId
: The id of the blog.filename
: The name of the file to be deleted.
DELETE "/delete-blog/:blogId"
This routes allows you to perform CRUD operations on article images.
Method: POST
Route: /upload/blog/:blogId/article/:articleId
Description: Uploads a new image for the article.
Headers: An authorization token is required to use this route.
Path Parameters:
blogId
: The id of the blog.articleId
: The id of the article.
Request Body: A file (newArticleImg
) containing the article image.
Method: GET
Route: /users/:userId/blogs/:blogId/articles/:articleId/files/:filename
Description: Retrieves the specified image for the article.
Path Parameters:
userId
: The id of the user.blogId
: The id of the blog.articleId
: The id of the article.filename
: The name of the file.
Method: PUT
Route: /update/blogs/:blogId/articles/:articleId/files/:oldFilename
Description: Updates the specified image for the article.
Headers: An authorization token is required to use this route.
Path Parameters:
blogId
: The id of the blog.articleId
: The id of the article.oldFilename
: The name of the file to be updated.
Request Body: A file (newArticleImg
) containing the new article image.
Method: DELETE
Route: /delete/blogs/:blogId/articles/:articleId/files/:filename
Description: Deletes the specified image for the article.
Headers: An authorization token is required to use this route.
Path Parameters:
blogId
: The id of the blog.articleId
: The id of the article.filename
: The name of the file to be deleted.