Design and Develop an HTTP JSON API capable of the following operations,
- Create an User
- Should be a POST request
- Use JSON request body
- URL should be ‘/users'
- Get a user using id
- Should be a GET request
- Id should be in the url parameter
- URL should be ‘/users/’
- Create a Post
- Should be a POST request
- Use JSON request body
- URL should be ‘/posts'
- Get a post using id
- Should be a GET request
- Id should be in the url parameter
- URL should be ‘/posts/’
- List all posts of a user
- Should be a GET request
- URL should be ‘/posts/users/'
getConnectionhandles connecting to the DBcreateUsercreats the user and pushing the user to DBhandleCreateUserhandles the creating of the user and showing the Id as rescreatePostcreates the Post and push to the DBhandleCreatePosthandles the createPost and shows the Id as resgetUsergets the user id and name from the DB and takes the:userIdas paramgetPostgets the post complete information saved in the DB and takes:postIdas paramlistPostlists all the posts created by the user and takes:userIdas param
- Users
- Posts
- instagram
- posts
- _id
- caption
- author
- PostedTimeStamp
- users
- _id
- name
- password (hashed)
- posts
Testing the API endpoints and there result

On Postman Testing results
Pagination has been used in the listPost and gives 2 posts for each page
Passwords are hashed before it is saved in the DB (using bcrypt)



