express-workshop
express-workshop copied to clipboard
Step 10: instructions unclear
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.
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?