/360-Imaging-task

Blog Rest-API

Primary LanguageJavaScript

360-Imaging-task

  • A simple blog Restful API using Node.js

Its available here, enjoy ❤️

https://blog-simple-api.herokuapp.com 🎉

Endpoints

For Post CRUD operations:

  • New post : '/api/post'
    method -> post
    body -> {
    author : (required),
    title : (required),
    post : (required - maxlength : 200)
    }
  • Delete post : '/api/post/postID'
    method -> delete
  • Edit post : '/api/post/postID'
    method -> patch
    body -> {title, post}
  • Show all posts : '/api/post'
    method -> get
  • Show a posts : '/api/post/postID'
    method -> get

For Comment CRUD operations:

  • New comment : '/api/comment'
    method -> post
    body -> {
    commenter : (required),
    comment : (required - maxlength : 100)
    }
  • Delete comment : '/api/comment/postID/commentID'
    method -> delete
  • Edit comment : '/api/commentcomment/postID/commentID'
    method -> patch
    body -> {comment}
  • Show all comments of a post : '/api/comment/postID'
    method -> get

📣 There is 16-unit test

Post a new post ✔️
Post a new post with missing attributes ✔️
Should Fetch all the Posts ✔️
Should Fetch specific post ✔️
ID doesn't exist to fetch ✔️
Update post ✔️
Delete Post ✔️
Delete Post doesn't exist ✔️
Update post doesn't exist ✔️

Add new comment ✔️
Add new comment to a deleted post ✔️
Should Fetch all the comments of a post ✔️
Update comment ✔️
Delete comment ✔️
Delete comment on deleted post ✔️
Update comment doesn't exist ✔️