express-workshop icon indicating copy to clipboard operation
express-workshop copied to clipboard

Step 10: instructions unclear

Open PRANAY100 opened this issue 6 years ago • 1 comments

The instructions asked to use res.sendFile. As the script.js is trying to GET request, its first confusing to use GET request in server.js as well, and to respond with the same blogpost again when POSTing it.

PRANAY100 avatar Mar 14 '19 05:03 PRANAY100

The responses serve different purposes: when script.js calls GET /get-posts, it is to return all historical blogposts, whereas POST /create-post just returns the latest one after it's created, so you can display it straight away. Does this clarify things?

minaorangina avatar Mar 14 '19 11:03 minaorangina