-
Notifications
You must be signed in to change notification settings - Fork 0
Routes
Walter Hills edited this page Jan 29, 2021
·
2 revisions
- Renders
login.pug
template containing login form - form action: '/login'
- form method: 'POST'
- Renders
signup.pug
template containing registration form - form action: '/users'
- form method: 'POST'
- creates a new user
- logs user in
- redirects to '/profile'
- logs the user out
- redirects to '/'
- Renders
profile.pug
- template variables needed: user(object containing information about user), posts(posts that will be filtered by userId)
- Renders
index.pug
- template variables needed: posts (array of posts from users)
- Renders
new-post.pug
template containing form to create a new post - form action: '/posts'
- form method: 'POST'
- creates a new post
- redirects to
posts/pid(pid is id of newly created post)
- renders index.pug template showing posts with only posts matching either category from drop down or from search term in search bar.
- render
post.pug
- template variables needed: post (include post comments)
- delete post with :id
- redirects to
/home
- creates a new comment with postId === req.params.id
- route will be hit when a user submits the comment form for post
- delete comment with :cid on post with :pid
- route will be hit when a user hits the delete button on their comment
An app created by: Walter Hills, Alpesh Vyas, and Yassine Cherradi