Skip to content

week two homework, Ryan Fields #14

Open
ryancfields wants to merge 1 commit into
pce-uw-jscript400:masterfrom
JSArchive:w2-repo
Open

week two homework, Ryan Fields #14
ryancfields wants to merge 1 commit into
pce-uw-jscript400:masterfrom
JSArchive:w2-repo

Conversation

@ryancfields
Copy link
Copy Markdown

No description provided.

Comment thread readme.md
I noticed it is powered by Express.

Headers are values that are passed in the response and also returned by the server. It is data that is exchanged between the client and server.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly metadata

Comment thread readme.md
* **Your Answer:**
- You can add any headers in the request in Postman under the Headers tab.

- When we add the console.log component, then on node we see logging of the headers on the node instance.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the console.

Comment thread readme.md
* **Question:** When does `app.use()` get called?

* **Your Answer:**
Always, it is called every time. It is just a general request for everything to go through.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always called as long as the request has made it to that point in the route chain.

Comment thread readme.md
* **Question:** What type of thing is `app` and what is its purpose?

* **Your Answer:**
app is the function that contains all of the methods we will use. When you invoke express you get app.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out instance of a server, also a function / event emitter

Comment thread readme.md
* **Question:** What type of thing is `next` and what does it represent in the callback?

* **Your Answer:**
Forward request to the next route that matches.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread readme.md
* **Your Answer:**

Route Parameters and not query parameters.
---
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

res.json({ message: Hello, ${req.params.username}! })

Comment thread readme.md

* **Your Answer:**

Fails to parse in Postman.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fails to parse the body in the server, and subsequently fails to respond to Postman

Comment thread readme.md
* **Question:** Try creating a new vegetable. Then, try restarting your server. What happens to the data you posted and why?

* **Your Answer:**
All gone, no persistent storage.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants