Releases: Ajdj100/proj_6_web
Releases · Ajdj100/proj_6_web
v0.2
Release v0.2
🛤️ Routes
GET /
- Route serves the Login.html page.
GET /article
- Serves the Articles.html page.
GET /browse
- Serves the Browse.html page.
GET /profile
- Expects a JSON request body with a 'user_id' field.
- Returns a 200 with the posts associated with this user in a JSON response body.
- Returns 500 if error with SQL query.
GET /post
- Returns the data associated with a user post.
- Explects a JSON field in the body called 'id' with the desired post id.
- Returns status code 500 if error with SQL query.
GET /posts
Returns a JSON list of the 5 next posts in the DB.
Expects a request with a JSON body and 'limit', 'current' fields.
Returns status code 500 if error with SQL query.
GET /username
- Returns the username as JSON in a field called 'username'.
- Expects the user id in the request body JSON in a field called 'user_id'.
- Returns status code 500 if error with SQL query.\
POST /login
- Returns 200 with user_id in JSON body if the credentials authenticated successfully.
- Expects JSON body with 'username' and 'password' fields.
- Creates cookie using authenticated user id called current_user.
- Returns 401 if authentication fails.
POST /signup
- Returns 200 with user_id in JSON body if the signup was successfull.
- Expects JSON body with 'username' and 'password' fields.
- Returns 500 if error inserting new user into DB.
POST /post
- Returns new post id in JSON body field 'insertId'.
- Expects user_id, title, and body in request JSON body.
- Returns 500 if error creating post.
POST /comment
- Returns new comment id in JSON as 'insertId'.
- Expects the commented post's id, user id, comment body in the request body as 'post_id', 'user_id', 'body'.
- Returns 500 if there is an error with the SQL query.
PATCH /post
- xpects a JSON body with 'title' and or 'body'.
- Updates the post given the new fields.
- Returns 200 with success message in response as 'message' JSON field.
- Returns 500 if error occurred during the update.
PUT /comment
- Expects a JSON body with 'comment_id', 'post_id' and 'body'.
- Replaces the comment with the new fields.
- Returns 200 with success message in response as 'message' JSON field.
- Returns 500 if error occurred during the update.
DELETE /post
- Expects a JSON body with the 'post_id'.
- Removes the matching post from the Db.
- Returns 200 success if query is successful.
- Returns 500 if error occurrred during query.
OPTIONS /
- Returns accepted header types and method types. Works globally, on all routes in the system.
What's Changed
- Header fixes not rushed by @Ajdj100 in #64
- Browse page wont scroll fix by @Ajdj100 in #66
- Busted routes out into their own files for better maintainability by @Ajdj100 in #68
- Profile page repeated articles fix by @Ajdj100 in #65
- Delete post functionality added by @Ajdj100 in #71
- Comment integration on article page by @AndrewStanley6786 in #72
- Add status prompt when creating new post. by @sebastian-j-ibanez in #73
- Implemented session storage for current user's username by @AndrewStanley6786 in #75
- Patch endpoint by @Toaninja in #77
- Fix HTML path references. Dotenv override setting. by @sebastian-j-ibanez in #78
- Logging update by @sebastian-j-ibanez in #79
- Add logging for editpost and patch. by @sebastian-j-ibanez in #82
- 85 edit post button by @Ajdj100 in #89
- Fix button link to EditPost.html from Profile.html. by @sebastian-j-ibanez in #92
- Edit page fixes by @Ajdj100 in #90
- Update the comment PATCH route to a PUT. by @sebastian-j-ibanez in #94
- Format imports. Fix username generation. by @sebastian-j-ibanez in #96
- Update PUT body.post_id parameter name. by @sebastian-j-ibanez in #97
Full Changelog: v0.1...v0.2
Release v0.1
🛤️ Routes
GET /
- Route serves the Login.html page.
GET /article
- Serves the Articles.html page.
GET /browse
- Serves the Browse.html page.
GET /profile
- Expects a JSON request body with a 'user_id' field.
- Returns a 200 with the posts associated with this user in a JSON response body.
- Returns 500 if error with SQL query.
GET /post
- Returns the data associated with a user post.
- Explects a JSON field in the body called 'id' with the desired post id.
- Returns status code 500 if error with SQL query.
-
GET /posts
- Returns a JSON list of the 5 next posts in the DB.
- Expects a request with a JSON body and 'limit', 'current' fields.
- Returns status code 500 if error with SQL query.
GET /username
- Returns the username as JSON in a field called 'username'.
- Expects the user id in the request body JSON in a field called 'user_id'.
- Returns status code 500 if error with SQL query.
POST /login
- Returns 200 with user_id in JSON body if the credentials authenticated successfully.
- Expects JSON body with 'username' and 'password' fields.
- Creates cookie using authenticated user id called current_user.
- Returns 401 if authentication fails.
POST /signup
- Returns 200 with user_id in JSON body if the signup was successfull.
- Expects JSON body with 'username' and 'password' fields.
- Returns 500 if error inserting new user into DB.
POST /post
- Returns new post id in JSON body field 'insertId'.
- Expects user_id, title, and body in request JSON body.
- Returns 500 if error creating post.
POST /comment
- Returns new comment id in JSON as 'insertId'.
- Expects the commented post's id, user id, comment body in the request body as 'post_id', 'user_id', 'body'.
- Returns 500 if there is an error with the SQL query.
PATCH /post
- Expects a JSON body with 'title' and or 'body'.
- Updates the post given the new fields.
- Returns 200 with success message in response as 'message' JSON field.
- Returns 500 if error occurred during the update.
PUT /comment
- Expects a JSON body with 'comment_id', 'post_id' and 'body'.
- Replaces the comment with the new fields.
- Returns 200 with success message in response as 'message' JSON field.
- Returns 500 if error occurred during the update.
OPTIONS /
- Returns accepted header types and method types. Works globally, on all routes in the system.
🗄️ File Changes
- Init server. Init routes. Rename index.js to server.js. by @sebastian-j-ibanez in #1
- Front end setup by @Ajdj100 in #3
- Populate db by @sebastian-j-ibanez in #22
- Db connection by @sebastian-j-ibanez in #27
- Added auth middleware by @Ajdj100 in #26
- Implemented login endpoint. by @sebastian-j-ibanez in #29
- Update scripts to use dotenv. Fix seed error. Fix comment bug. by @sebastian-j-ibanez in #28
- Browse posts endpoint by @Ajdj100 in #31
- Added User signup Post request by @AmirLevant in #32
- Add dockerfile. by @sebastian-j-ibanez in #33
- Get post endpoint implemented for single articles by @AndrewStanley6786 in #34
- Browse/home page base functionality by @Ajdj100 in #36
- Post creation endpoint from main by @AmirLevant in #37
- Revert "Post creation endpoint from main" by @sebastian-j-ibanez in #38
- fixed post sql query by @AmirLevant in #39
- Comment route endpoint by @AmirLevant in #40
- Login page by @sebastian-j-ibanez in #42
- Browse scrolling by @Ajdj100 in #41
- Patch post by @AmirLevant in #47
- Add middleware to handle OPTIONS requests. by @sebastian-j-ibanez in #43
- View single article page by @AndrewStanley6786 in #48
- Finished Patch Comment by @AmirLevant in #49
- Browse is working with the single article page! by @AndrewStanley6786 in #50
- Add authChecker middleware. Add cookie-parser. by @sebastian-j-ibanez in #52
- Patch with different scenarios added, depending if only body or title… by @AmirLevant in #55
- Fix article IP. Set server side cookies. by @sebastian-j-ibanez in #54
- Integrate create comment by @AndrewStanley6786 in #58
- Create article page by @Ajdj100 in #57
- Profile has functionality by @Toaninja in #59
- Fixed the issue with navigation to posts by @Ajdj100 in #60
- Fix authCHecker. by @sebastian-j-ibanez in #61
- fixed head by @Ajdj100 in #62
Full Changelog: https://github.com/Ajdj100/proj_6_web/commits/v0.1