Answered questions from readme file and modified app.js file#8
Open
marnel-mangrubang wants to merge 1 commit intopce-uw-jscript400:masterfrom
Open
Answered questions from readme file and modified app.js file#8marnel-mangrubang wants to merge 1 commit intopce-uw-jscript400:masterfrom
marnel-mangrubang wants to merge 1 commit intopce-uw-jscript400:masterfrom
Conversation
MadEste
reviewed
Jul 13, 2019
| * **Question:** When does `app.use()` get called? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** `app.use()` gets called before the routes since it is before any of our routes. |
MadEste
reviewed
Jul 13, 2019
| * **Question:** What type of thing is `app` and what is its purpose? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** `app` is function with many methods. |
There was a problem hiding this comment.
correct. app is our instance of the server and also an event emitter.
MadEste
reviewed
Jul 13, 2019
| * **Question:** What type of thing is `next` and what does it represent in the callback? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** `next` is the continue action in the callback. It tells our code to continue with the response after the request is made. |
MadEste
reviewed
Jul 13, 2019
| * **Question:** The above can be described as middleware. Describe what middleware is in your own words and how it differs from building a route. | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** Middleware is the code that runs before any route is met. Middleware can be used to do run authentication, validation or test. |
There was a problem hiding this comment.
Correct, although Middleware can also be applied between routes as well as before them.
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:** The data that I just created is gone because we did not save it to any database. |
MadEste
reviewed
Jul 13, 2019
| * **Question:** Take a look at the `package.json` file. What is [standardjs](https://standardjs.com/) and what will it do for you? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** `standardjs` is a javascript code auto formatter. It can save my time cleaning out my code and keeping it consistent. |
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.
Lesson notes from class and answers to the questions in the readme file