Implementation from Stephen
express
and mongoose
$node app.js
Postman
to do the check the endpointsPOST /users
to create new userGET /users/{userId}
to view an user by IDPOST /users/{userId}/posts
to create a new post under an userGET /users/{userId}/posts
to list all posts owned by an usersGET /users/{userIdd}/posts/{postId}
to get one post owned by an usersposts
-> All posts in the databaseposts/limit
-> Returns posts with a certain amount (default 200). For example posts/limit=20
.posts/title
-> Matches posts with a title (default all posts). For example posts/title=book
.posts/sort
-> Returns posts which are sorted by either title or time(default by ascending order). For example, posts/sort=title:desc,createdAt:desc
POST user/random/:number
-> Creates (number) users with random names, DoB, and 10 posts of each created user.node-random-name
, random-birthday
, node-randomstring
and random-date-generator
.