Tom Workman | w2-express assignment#9
Open
tworkman512 wants to merge 10 commits intopce-uw-jscript400:masterfrom
Open
Tom Workman | w2-express assignment#9tworkman512 wants to merge 10 commits intopce-uw-jscript400:masterfrom
tworkman512 wants to merge 10 commits intopce-uw-jscript400:masterfrom
Conversation
MadEste
reviewed
Jul 13, 2019
| * **Question:** What are headers? What values do you recognize? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** Expresss is powering it, the `Content-Type` looks familiar, and the `Date` information. |
There was a problem hiding this comment.
Returns metadata, usually info about the server and the response.
MadEste
reviewed
Jul 13, 2019
| * **Question:** When does `app.use()` get called? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** `app.use()` is a general function for every request to go through and is called when it finds a match for a specified path. |
There was a problem hiding this comment.
Remember app.use will always be called if a request has reached that point of the route chain.
MadEste
reviewed
Jul 13, 2019
| * **Question:** What type of thing is `app` and what is its purpose? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** `app` is a middleware function. It's job is to parse incoming requests with JSON payloads and has many different methods on it, one of which is `.get()`. |
There was a problem hiding this comment.
In this case app is the instance of our server itself.
MadEste
reviewed
Jul 13, 2019
| - **Question:** Try creating a new vegetable. Then, try restarting your server. What happens to the data you posted and why? | ||
|
|
||
| * **Your Answer:** | ||
| - **Your Answer:** My data did not persist. This happened because as of now, it's just using the HTTP `POST` method to send data to a route and we are not using a database or a JSON file to store the contents that are being created. |
There was a problem hiding this comment.
Correct, the data is being stored as an object which does not persist once the server is restarted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completed questions for the w2-express assignment.