HTTP Routes, Responses and Required
- POST /users/signup
tokenRequired: false
Body: {email, password, name}
Response: {token, user}
- POST /users/signin
tokenRequired: false
Body: {email, password}
Response: {token, user}
- POST /users/signout
tokenRequired: false
Body: {email, password}
Response: {message}
- GET /users/:id
- GET /users/email/:email
tokenRequired: false
Body: {}
Response: {user}
- PATCH /users/:id
tokenRequired: true
Body: {name, tags}
Response: {user}
- POST /posts/create
tokenRequired: true
Body: {title, body, tags}
Response: {post}
- GET /posts/post/:id
tokenRequired: false
Body: {}
Response: {post}
- GET /posts/:userID
tokenRequired: false
Body: {}
Response: {posts}
- PATCH /posts/update/:id
tokenRequired: true
Body: {content, title, tags}
Response: {post}
- DELETE /posts/delete/:id
tokenRequired: true
Body: {}
Response: {message}
- GET /posts/feed/:postID
tokenRequired: true
Body: {}
Response: {posts}
postID: optional <null | lastPostID> (required for pagination)
Comments
CreateComment:
- POST /comments/create/:postID
tokenRequired: true
Body: {content}
Response: {comment}
GetComments:
- GET /comments/:postID
tokenRequired: false
Body: {}
Response: {comments}
UpdateComment:
- PATCH /comments/update/:commentID
tokenRequired: true
Body: {content}
Response: {comment}
DeleteComment:
- DELETE /comments/delete/:commentID
tokenRequired: true
Body: {}
Response: {message}