Question: Name & Description HTTP Method Data Types Errors / This is an example route that we will implement for you. Display a message when the

Name & Description HTTP Method Data Types Errors / This is an example route that we will implement for you. Display a message when the root URL of the server is accessed directly. Difficulty: N/A GET Query Parameters {} Return Object {message} N/A /echo/echo This is an example route that we will implement for you. Echoes the given message back to the caller. Difficulty: N/A GET Query Parameters {message} Return Object {message} Return {error} with status code 400 when any of: when the message passed in is exactly echo. /post/create Adds a new post to our forum. Difficulty: POST Body Parameters {sender, title, content} Return Object {postId} Return {error} with status code 400 when any of: sender is an empty string, "" title is an empty string, "" content is an empty string, ""/post/:postid/comment Adds a new comment to a forum post. Difficulty: POST Body Parameters {sender, comment} Return Object {commentId} Return {error} with status code 400 when any of: postid does not refer to an existing post sender is an empty string, "" comment is an empty string, ""/post/:postid Fetch all details about a single forum post. Comments in the post are sorted such that the most recent comment will appear at index 0. For example, if three comments are made in the order c1, c2 and c3, the returned list will contain [c3, c2, c1]. Difficulty: GET Query Parameters {} Return Object {post} Return {error} with status code 400 when postid does not refer to an existing post. /post/:postid Edits a single forum post. Note that the timeSent for this post remains unchanged. Difficulty: PUT Body Parameters {sender, title, content} Return Object {} Return {error} with status code 400 when postid does not refer to an existing post sender is an empty string, "" title is an empty string, "" content is an empty string, ""/posts/list Fetch brief details about all forum posts. Posts are sorted such that the most recent post will appear at index 0. For example, if three posts are made in the order p1, p2 and p3, the returned list will contain [p3, p2, p1]. Difficulty: GET Query Parameters {} Return Object {posts} N/A /clear Clear all data and returns an empty object. Difficulty: DELETE Query Parameters {} Return Object {}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!