Shahab w2-espress class notes#12
Open
Shahab13 wants to merge 4 commits intopce-uw-jscript400:masterfrom
Open
Conversation
MadEste
reviewed
Jul 13, 2019
|
|
||
| ## Express.js is a node.js framework which makes it easy to work with server side applications and takes care of lots of repetitive things for us. | ||
|
|
||
| ## morgan provides logging |
MadEste
reviewed
Jul 13, 2019
| * **Your Answer:** | ||
|
|
||
| --- | ||
| ## Query parameters are used to make our request more specific. In this case we send them as a key:value pairs. |
There was a problem hiding this comment.
Query parameters are often used for filters etc.
MadEste
reviewed
Jul 13, 2019
| * **Your Answer:** | ||
|
|
||
| --- | ||
| ## app.use() is a general function for every request to go through |
There was a problem hiding this comment.
Remember each request moves down the list until it finds an endpoint and will only continue if next is called inside a function.
MadEste
reviewed
Jul 13, 2019
| * **Your Answer:** | ||
|
|
||
| * **Question:** What type of thing is `app.get()` and what is its purpose? | ||
| ## The type of 'app' is Object which has multiple function attached to it. node.js starts the Express.js and app is being used to start up our server |
MadEste
reviewed
Jul 13, 2019
| - **Your Answer:** | ||
|
|
||
| * **Question:** What type of thing is `res` and what does it represent in the callback? | ||
| ## This is the pass represented by '/'. |
There was a problem hiding this comment.
Path represented, in this case the home.
MadEste
reviewed
Jul 13, 2019
| - **Your Answer:** | ||
|
|
||
| ## Just need change the 'app.get' to 'app.post' | ||
|
|
MadEste
reviewed
Jul 13, 2019
| - **Question:** Right now all of our requests will return a "Status Code" of 200. Define what a status code is and research how you could change it. | ||
|
|
||
| - **Your Answer:** | ||
|
|
There was a problem hiding this comment.
What do Status codes do and why are they important?
MadEste
reviewed
Jul 13, 2019
| - **Question:** Look for `helpers.validate` in the `app.js` file. What is this and how does it work? | ||
|
|
||
| * **Your Answer:** | ||
| - **Your Answer:** |
There was a problem hiding this comment.
Gives some middleware functionality. Look how helpers is being used on line 33
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.
No description provided.