Continuing the starter project here, add the following features:
Complete the posts.js
file adding implementations for the following routes
- /posts/all
- /posts/:user_id
- /posts/register
Add UI elements to:
- Display all posts
- Display all posts from a given user
- Create a new post
Add a new table likes
that represents a user liking a post. It should have the structure below:
- Likes
id
: integer, primary keyliker_id
: integer, foreign key referencing the columnid
in Userspost_id
: integer, foreign key referencing the columnid
in Posts.
Seed the database with likes.
Then, add the following functionality:
- Display the number of likes of each post
- Display users who have liked each post
- Filter posts by the number of likes (e.g show only posts with 5+ likes)