You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 text was updated successfully, but these errors were encountered:
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?
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 text was updated successfully, but these errors were encountered: